Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Reply to Sandbox file access
Sorry but i can't understand how this work. In documentation write, create an app-scoped bookmark for that folder, ok, im tryNSURL *openPanelFileURL = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];NSError *error = nil; BOOL bookmarkDataIsStale;NSData *bookmarkData = nil;bookmarkData = [openPanelFileURL bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys:nil relativeToURL:nil error:&error];if (error) { NSLog(@Error creating bookmark for URL (%@): %@, urlString, error); [NSApp presentError:error];but see error in terminalError creating bookmark for URL (/Users/username/Desktop/test/): Error Domain=NSCocoaErrorDomain Code=262 Scoped bookmarks can only be made with file URLs UserInfo={NSURL=/Users/username/Desktop/test/, NSDebugDescription=Scoped bookmarks can only be made with file URLs}Your need create app-scoped for folder, but your can't create app-scoped for folder ??? ***???What wrong?
Topic: Code Signing SubTopic: General Tags:
Jan ’17
Correct way to check for existence of Touch ID on Mac
I have some code to check for the existence of Touch ID on my Mac app and it's causing crashes. One on El Capitain and a crash on macOS Sierra.Here's my code:if (NSClassFromString(@LAContext)) { LAContext *myContext = [[LAContext alloc] init]; NSError *authError = nil; if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) { self.enableTouchIDButton.hidden = NO; } else { self.enableTouchIDButton.hidden = YES; } } else { self.enableTouchIDButton.hidden = YES; }On El Capitan on a Mac Pro this results in this kind of crash:Application Specific Information: Crashing on exception: Unexpected error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.CoreAuthentication.daemon was invalidated. UserInfo={NSDebugDescription=The connection to service named com.apple.CoreAuthentication.daemon was invalidated.} Application Specific Backtrace 1: 0 CoreFoundation 0x00007fff96f7d452 __exceptionPreprocess + 178 1 libobjc.A.dylib 0x00007
Topic: UI Frameworks SubTopic: AppKit Tags:
3
0
2.7k
Feb ’17
Fetching Changed Data from Cloudkit Server
Hello Sir/MamI am trying to implement Cloud sync in my application and I have implemented cloudkit framework also.Now I am trying to fetch record changes with CKFetchRecordZoneChangesOperation.But I am getting operation error :[LogFacilityCK] Got a connection error for operation B2EC16FD78756E1A: Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.cloudd UserInfo={NSDebugDescription=connection to service named com.apple.cloudd}When I am sending nil PreviousServerchangetoken that time it works great but when I am attaching CKFetchRecordZoneChangesOptions that time it throws error.Please Help MeBelow is my code:- (void)_fetchRecordChangesWithCompletionHandler: (void (^)(UIBackgroundFetchResult result, BOOL moreComing))completionHandler { CKServerChangeToken *prevServerChangeToken = nil; if ([[NSUserDefaults standardUserDefaults]objectForKey:KPREVSERVERCHANGETOKEN] != nil) { prevServerChangeToken = [[NSUserDefaults standardUserDefaults]objectForKey:KPREVSERVERCHANGETOKEN]; }
0
0
797
Feb ’17
Error Domain=NSCocoaErrorDomain Code=518 "The file couldn’t be saved because the specified URL type isn’t supported."
Hello, I'm trying to save some Strings in a csv document: var tempString = String() for Rezept in alleRezepte { tempString += (Rezept.name), (Rezept.description), (Rezept.nutrients), (Rezept.whatToDo)n } let dirs = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .allDomainsMask, true) as? [String]) let path = dirs?[0].appending(rezepte.csv) let url = URL(string: path!) do { try tempString.write(to: url!, atomically: true, encoding: String.Encoding.utf8) } catch { print(error) } print(Daten gesichert)And I get this error:CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no schemeError Domain=NSCocoaErrorDomain Code=518 The file couldn’t be saved because the specified URL type isn’t supported.How can I fix this?Thank you for helping.
9
0
23k
Feb ’17
Reply to Error Domain=NSCocoaErrorDomain Code=518 "The file couldn’t be saved because the specified URL type isn’t supported."
If I change line 7 to:let url = URL(fileURLWithPath: path)I get this new error:Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “Documentsrezepte.csv” in the folder “7628BDA0-E8BD-4058-B49F-9A3B70F1FC02”. UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/7628BDA0-E8BD-4058-B49F-9A3B70F1FC02/Documentsrezepte.csv, NSUnderlyingError=0x170055c00 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}
Topic: Programming Languages SubTopic: Swift Tags:
Feb ’17
Handling crashes in NSDocumentController reopen logic w/o subclassing?
Hi there,Our users are experiencing crashes in the App Kit code when NSDocumentController is trying to reopen a document that the user has no longer access to.Not sure how that happens in the wild, might be just another OS bug, however it's easy to replicate with some chown/chmod magic..Is there a way to handle this error or display it to the user?At the moment it's only displayed on the Console - which neither points the user to the cause of the issue nor gives our app any way to intercept and prevent App Kit from crashing.The NSDocumentController method causing the problem/console output is:2017-02-18 06:15:56.838164 My App [6036:900355] -[NSDocumentController reopenDocumentForURL:withContentsOfURL:display:completionHandler:] failed during state restoration. Here's the error:Error Domain=NSCocoaErrorDomain Code=257 The autosaved document “test.layout” could not be reopened. You don’t have permission. UserInfo={NSLocalizedFailureReason=You don’t have permission., NSLocalizedDescription=The autosaved
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
490
Feb ’17
macOS: accessing /var/log/jamf.log with sandboxed app
I'm trying to parse /var/log/jamf.log (line by line), while having a sandboxed application.My entitlements file: <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key> <array> <string>/var/log/jamf.log</string> </array> </dict>(I also tried with .read-only)Running code: do { self.logFileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: /var/log/jamf.log, isDirectory: false)) } catch { dump(error) self.logFileHandle = nil }With this, I get the following error:> Error Domain=NSCocoaErrorDomain Code=1 (null)> UserInfo={NSFilePath=/var/log/jamf.log}Anyone has an idea? Is it possible that / corresponds to the root of the sandbox?Thanks!FrançoisPS: Also asked on http://stackoverflow.com/questions/42585294/accessing-var-log-jamf-log-with-sandboxed
0
0
1.4k
Mar ’17
Open mailto link from UIWebView
Hi everyone I am trying to develop a webView application. Inside my webview I have a mailto link and I want to open it outside the webview on the mail application of iOS.This is my code func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool{ print(stampa richiesta : ) print(request) var stringaURL = / stringaURL = try! String(contentsOf: request.url!, encoding: String.Encoding.ascii) / / / if navigationType == UIWebViewNavigationType.linkClicked{ if((stringaURL.range(of:www.collegiodeirettori.net/palio/)) != nil ){ print(stampa richiesta : ) print(request) } else{ print(stampa richiesta : ) print(request) UIApplication.shared.openURL(request.url!) / return false; } } return true; }I already made a func that control if a link have to be opened in safari and that works but no for the mailto link.. Any ideas? Thanks!This is the error that report when I click on mailto link :fatal error: 'try!' expression unexpectedly raised an error: Error
1
0
4.5k
Mar ’17
Unable to create build using enterprise program
Hi all,I am trying to create a ios build using apple in-house enterprise certificate and provisioning profile for distribution. It seems in very bad shape for me, terminal shows some errors which i am realy unable to understand, it looks like a mess for me. here it is :2017-03-21 20:54:16.618 xcodebuild[5238:75951] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 2044. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.2017-03-21 20:54:16.633 xcodebuild[5238:75951] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 2044. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.2017-03-21 20:54:16.635 xcodebuild[5238:75951] Error Domain=NSCocoaErrorDomain Code=3840 Unexpected character / at line 1 UserInfo={NSDebugDescription=Unexpected character / at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 Missing ';' on
0
0
455
Mar ’17
iOS 10.3 (APFS) iTunes file sharing problem with Asian characters
I've got multiple reports from users about problem after updating to iOS 10.3.Users can't access files that are transferred using iTunes file sharing after upgrading to iOS 10.3.This problem doesn't happen when transferring files with only alpha numeric characters.Bug was present when transferring file names with Korean and Japanese.It transfers without any problem and shows up correctly in iTunes(file sharing).But the file is not accessible from the app.The file is listed in NSFileManager::contentsOfDirectoryAtPath.But when checking the file with NSFileManager::attributesOfItemAtPathit fails with Error Domain=NSCocoaErrorDomain Code=260 The file “KoreanJapaneseCharacters.txt” couldn’t be opened because there is no such file. UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/0353E581-F595-4E83-83C0-AAFBF4589A8A/Documents/KoreanJapaneseCharacters.txt, NSUnderlyingError=0x17025d880 {Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}} ( Had to replace filename because this webs
14
0
7.8k
Apr ’17
NEPacketTunnelProvider: Problem with presence of framework
In late 2015/early 2016 we were working on a Network Extension VPN (censorship circumvention tool) that was sort of working, but we coudn't get past the 5MB memory limit (rdar://27660401). We want to try it out again with the new memory limit, but we can't get it working even to the degree that it was before.Here's the code: https://github.com/adam-p/psiphon-ios-PoC/tree/master/PsiphonThe really odd thing (to me) is that the problem seems to be presence of our framework in the network extension (PsiphonTunnel.framework in the above repo). (Presence because the same failure occurs even if all calls to the framework are removed. Fully removing the framework is necessary.)Here's the framework source, in case it's relevant:https://github.com/Psiphon-Labs/psiphon-tunnel-core/tree/ios-beta/MobileLibrary/iOS/PsiphonTunnelAllow app extension API only is enabled for the framework, but doesn't seem to make a difference.Here's some successful-er log output with the framework removed:Apr 5 14:30:14 iPhone7 mediaserverd(A
2
0
1.4k
Apr ’17
Reply to iOS 10.3 (APFS) iTunes file sharing problem with Asian characters
I was able to reproduce the bug by transferring from Korean Windows 10 using iTunes.Thanks to musebook for the information about reproducing the bug.I've created txt files from Windows, Mac and transferred using Windows iTunes and Mac iTunes. I also created a file directly from iOS.Here's the array returned from [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:&error]; Mac U1112U1161U11abU1100U1173U11af.txt, Windows Ud55cUae00.txt, iOS U1112U1161U11abU1100U1173U11af.txtAll files have same 'Hangul Korean 2 letters with prefix where they came from. Mac and iOS share the same Unicode and file from Windows have different Unicode. When I NSLog each NSString from the array, I could see correct Korean output. I also see all files from iTunes file sharing correctly both from Windows and Mac.When doing attributesOfItemAtPath with: NSString *filepath = [path stringByAppendingPathComponent:filename]; NSDictionary *dict=[fileManager attributesOfItemAtPath:filepath error:&error];The Windows <
Apr ’17
Reply to setAlternateIconName: did anyone manage to make it work?
Just a heads up for my fellow Googlers, I was having trouble implementing this in my app. Using the simulator, iPhones would work, but iPads would not. I was seeing this error:error: Error Domain=NSCocoaErrorDomain Code=4 The file doesn't exist. UserInfo={NSUnderlyingError=0x60800044b3a0 {Error Domain=LSApplicationWorkspaceErrorDomain Code=-105 iconName not found in CFBundleAlternateIcons entry UserInfo={NSLocalizedDescription=iconName not found in CFBundleAlternateIcons entry}}}I was referencing these two example repos:https://github.com/steventroughtonsmith/AlternateIconTesthttps://github.com/iSame7/AlternateAppIconsI tried a bunch of debugging stuff and finally hit upon something that seems to help. I noticed if I replaced the contents of my AppIcon.appiconset/Contents.json file with one from the example repos, things seem to work on the iPad. I'm not 100% sure what's going wrong, but my Contents.json specifies a filename and I suspect that's the root of the problem. Hopefully this helps future fr
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’17
Can Address Sanitizer be used on a Network Extension ?
I'm trying to debug what appears to be a high rate traffic memory corruption related issue in a Network Extension and am attempting to run the Address Sanitizer to help track the issue down. With the Address Sanitizer enabled the Network Extension fails to start correctly. Does anyone know if this is a supported operation mode ? Without Address Santization the tunnel executes and can be debugged successfully.If I attempt to attach the Xcode debugger to the extension as it starts there is some indication that the session is starting but then it dies.default 13:57:09.831134 +0100 nesessionmanager NESMVPNSession[ACME VPN:0AA30726-7734-40A5-8387-43FCF341B0D9]: Received a start command from ACME[524]default 13:57:09.836846 +0100 nesessionmanager NESMVPNSession[ACME VPN:0AA30726-7734-40A5-8387-43FCF341B0D9]: status changed to connectingdefault 13:57:09.847652 +0100 neagent calling plugIn beginUsing:default 13:57:09.849673 +0100 pkd allowing host 296 <private> to use plug-in <private>(<private>) uu
0
0
618
Apr ’17
UIDocumentInteractionController NSURL and latin characters
Hello,I am using UIDocumentInteractionController to share custom documents from my app.When prodividing an URL to a local file path containing characters with accents, it will failed right after the user choose a sharing option.This problem happens on 10.3, but works perfectly in iOS 9.3.5.My app is mainly written in C++14, and uses UTF-8 encoding for strings.I do the following:NSURL* fileURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:rPath.GetChars()] isDirectory:!rPath.IsLeaf()]; mpDocController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];Which gives this error, after a sharing method/option is selected (for example, e-mail):Couldn't get file size for file:///var/mobile/Containers/Data/Application/FEEF7EA0-E4C5-4EC0-9A03-BB4BFF169729/Documents/Sessions/lo%CC%8 2o%CC%88o%CC%84%C5%93o%CC%83l/lo%CC%82o%CC%88o%CC%84%C5%93o%CC%83l.bm3: Error Domain=NSCocoaErrorDomain Code=260 The file “lôöōœõl.bm3” couldn’t be opened because there is no such file. UserInfo={NSU
Topic: UI Frameworks SubTopic: UIKit Tags:
5
0
2.0k
Apr ’17