Hello all! I've killed a few days trying to save a file and list it in a home directory. First I retrieve a home directory URL. I tried several options: docDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) docDir = URL(fileURLWithPath: NSHomeDirectory()) In any way when running on simulator or my iPhone it results in just file:/// Well, maybe that's ok for sandboxed iOS app... After that I prepare a file URL. I tried two ways: let file = docDir.appendingPathComponent(myfile.tmp) let file = URL(fileURLWithPath: myfile.tmp) print(file.absoluteURL) Here I get file:///myfile.tmp Finally I try to create file do { try Data(count: 0).write(to: file2) } catch { print(Failed to create file: '(file)' because of: (error)) } And here is what I get On simulator: Failed to create file: './myfile.tmp -- file:///' because of: Error Domain=NSCocoaErrorDomain Code=642 You can’t save the file “myfile.tmp” because the volume “AirHD — данные” is read only.
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My iOS app supports a document type and includes the appropriate UTI data. It can therefore open documents of a specific type from mail attachments, for instance. It works well.I am currently stumped, however: when I open a document from the iCloud Drive app (tap document, share button, Copy to <app>) my application gets launched but any attempts to copy the item from the provided URL fails with NSCocoaErrorDomain, error 257 (basically telling me I don't have the permissions to read the file). This issue is not present when my app is running in the background, however, and does not seem to occur when the app gets launched from a mail attachment (whether it's running ot not).I compared the URLs handed to my app and they are identical, whether the app was running or not.Here's the URL my app is handed: file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/filename.extThe code I'm using is the following:// uniqueURL is a destination URL in my app's sandbox: // file:///var/mobil
I'm trying to use Apple's CoreDataCloudkitDemo app. I've only changed the app settings per the README document. On running the demo, I'm getting the error: CloudKit integration requires does not support ordered relationships.The console log shows:Fatal error: ###persistentContainer: Failed to load persistent stores:Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={NSLocalizedFailureReason=CloudKit integration requires does not support ordered relationships. The following relationships are marked ordered: Post: attachmentsDoes anyone have a workaround, or preferably, a fix? Or did I do something wrong?Thanks
So what you probably should do is to try and create the directory first, without even checking if it exists first.Well, no. If the directory already exists, and I try to create it, I'm going to get an error which once again, is not an error. I just want the folder to be there, so if it already is, then great! Not a problem. Now, I could just ignore the error on folder creation, but then the problem is that in the case that the folder didn't already exist, now suddenly I do care about the error. I could do a checkURLIsReachable() after trying to create the folder, but then I'll get the wrong error — I don't want to know that the folder doesn't exist, I want to know why I couldn't create it.Anyway, either way this is going to require the ignoring of some error somewhere.If it is important for some reason to check first, do that, but remember that the directory might appear between your call to check for existence and you actually trying to create it.If we're talking about something in ~/Library/Caches/<my ap
Topic:
Programming Languages
SubTopic:
Swift
Tags:
I have an app on App Store and some users started seeing this bug when the app requests for Screen Time API usage. The error is The data couldn't be read because it isn't in the correct format. But it works still for most users and I can't reproduce it on my device. Checking the competitors, some of them shows this error when requesting for ScreenTime usage: An unknown error occurred: NSCocoaErrorDomain, 4864) Has anyone experienced this? Thank you! My code below requesting screen time authorization .onAppear { Task { do { try await center.requestAuthorization(for: .individual) if center.authorizationStatus == .approved { self.checkApproved() } else { state = .denied } } catch let error { showingAlert = true errorTitle = error.localizedDescription state = .denied } } }
We are a picture design company. When we use the Photos library to store pictures to albums, we encountered a large number of user album storage failure cases. The most error code is 41002, but I don't know how to fix it, or avoid it. Error Example: Error Domain=com.apple.photos.error Code=41002 Unable to obtain assetsd XPC proxy for getPhotoKitAddServiceWithReply:. assetsd could have crashed UserInfo={NSLocalizedDescription=Unable to obtain assetsd XPC proxy for getPhotoKitAddServiceWithReply:. assetsd could have crashed, NSUnderlyingError =0x2818a8b70 {Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.apple.photos.service UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.photos.service}}}
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
Adding to above, both for posterity and hoping that someone will pick it up and poke someone internally at Apple :-) I went jumping through all the hoops necessary (disabling SIP, remounting, clicking through warning messages about insecure setup etc) to modify sandbox-profiles for system services (i.e. those in /System/Library/Sandbox/Profiles/). Adding explicit allow of mach-lookup for com.apple.contactsd.persistence to com.apple.imagent.sb (assuming this should alter the process sandbox for imagent), com.apple.coredatad.sb (Family-process ought to stem from there?) and searchpartyuseragent.sb (for process searchpartyuseragent) alter their behaviour, but the Family Framework seems to be in such a bad state without SIP et al enabled I don't really know if it actually fixes the issue. Anyhow, I want to explicitly note that neither com.apple.imagent.sb, com.apple.coredatad.sb nor searchpartyuseragent.sb seems to include an allow of mach-lookups for com.apple.contactsd.persistence (however, some of them allow l
Topic:
Privacy & Security
SubTopic:
General
Tags:
Our FileProvider-Extension used to work perfectly in previous iOS versions. Starting with iOS 13 we keep getting the following error randomly when accessing files (stored in the app group):Error Domain=NSCocoaErrorDomain Code=4101 Couldn’t communicate with a helper application. UserInfo={NSUnderlyingError=0x281edd1a0 {Error Domain=NSFileProviderInternalErrorDomain Code=7 A connection to the extension “com.ourdomain.ourapp.DocumentProviderFileProvider” could not be made. UserInfo={NSLocalizedDescription=A connection to the extension “com.ourdomain.ourapp.DocumentProviderFileProvider” could not be made., NSUnderlyingError=0x281edcb10 {Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.ourdomain.ourapp.DocumentProviderFileProvider.apple-extension-service UserInfo={NSDebugDescription=connection to service on pid 0 named com.ourdomain.ourapp.DocumentProviderFileProvider.apple-extension-service}}}}}Our FileProvider implements these methods:func itemChanged(at url: U
Since feedback assitant does not allow bug reports in beta-2, I'll drop this here.Howdy, I just installed Xcode 11 beta 2, and ran my slightly modified version of the UIDocumentBrowserViewController-based template app, which was working the last time I tried it. However, in Xcode 11 beta 2, in the iPad simulator, it no longer works. I have another app which uses the same template, but had been modified to click the checkbox and run for Mac, and it has the same trouble.Here are the error logs[DocumentManager] Failed to get the remote browser View Controller with error (Error Domain=NSCocoaErrorDomain Code=4097 connection on anonymousListener or serviceListener from pid #### UserInfo={NSDebugDescription=connection on anonymousListener or serviceListener from pid ####})[DocumentManager] Remote view controller crashed with error: Error Domain=NSCocoaErrorDomain Code=4097 connection on anonymousListener or serviceListener from pid #### UserInfo={NSDebugDescription=connection on anonymousListener
Hello all. I face problem with Notification Service Extension. User mobile receive notification without any problem, payload contain mutable-content:1 inside it ( also, full example of payload is attached ), but, NSE didn't run correctly, also, original content of notification didn't saw ( in case, and there is a crash because of something wrong in app ) I checked device logs, and I see next errors: [*] Mutated notification request is nil, will supress original content; notificationRequest=7019-8D60, error=Error Domain=NSCocoaErrorDomain Code=4097 connection from pid 487 on anonymousListener or serviceListener UserInfo={NSDebugDescription=connection from pid 487 on anonymousListener or serviceListener}, runtime: 0.410339 [*.notificationextension] Service extension connection encountered an error: sessionUUID=88D39801-67DF-4DC7-AA70-2AD7E8634369, error=Error Domain=NSCocoaErrorDomain Code=4099 The connection from pid 505 on anonymousListener or serviceListener was invalidated: client is gone.
Topic:
App & System Services
SubTopic:
Notifications
Tags:
APNS
Notification Center
User Notifications
I'm trying to use ThreadNetwork API to manage TheradNetworks on device (following this documentation: https://developer.apple.com/documentation/threadnetwork/), but while some functions on THClient work (such as getPreferedNetwork), most don't (storeCredentials, retrieveAllCredentials). When calling these functions I get the following warning/error: Client: -[THClient getConnectionEntitlementValidity]_block_invoke - Error: -[THClient storeCredentialsForBorderAgent:activeOperationalDataSet:completion:]_block_invoke:701: - Error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service with pid 414 named com.apple.ThreadNetwork.xpc was invalidated from this process. UserInfo={NSDebugDescription=The connection to service with pid 414 named com.apple.ThreadNetwork.xpc was invalidated from this process.} Error Domain=NSCocoaErrorDomain Code=4099 The connection to service with pid 414 named com.apple.ThreadNetwork.xpc was invalidated from this process. UserInfo={NSDebugDescription=The c
The code here works on Mac Catalyst, and on the iOS simulator; on a physical iOS device it throws an error on the try Data line with an error, NSCocoaErrorDomain Cocoa=257: The file couldn't be opened because you don't have permission to view it. let puzzleParser = PuzzleParser() var pseudoPuzzleData: Data let urlToLoad = UserDefaults.standard.url(forKey: lastSavedDocument) if urlToLoad != nil { let decoder = JSONDecoder() do { let result = urlToLoad?.startAccessingSecurityScopedResource() print(hello from loadInitialPuzzle(), (result)) pseudoPuzzleData = try Data(contentsOf: urlToLoad!) urlToLoad?.stopAccessingSecurityScopedResource() AppDelegate.puzzle = try decoder.decode(Puzzle.self, from: pseudoPuzzleData) } catch // etc. Any ideas why this is happening, and what to do about it? I could really use some help here ...
I'm wondering if this is an issue with the NSPersistentContainer or something else is going on but when I launch the new model for my app and try to save a new relationship to an object it fails.Unresolved error Error Domain=NSCocoaErrorDomain Code=134020 The model configuration used to open the store is incompatible with the one that was used to create the store.NSUnderlyingException=Can't resolve how to assign objects to stores; some objects may have been assigned to stores; use [[managedObject objectID] persistentStore] to find out what is going where nowThis only happens on the first launch and I can see why. The configuration name is reported as PF_DEFAULT_CONFIGURATION_NAME rather than Users as it should be. Once the app is relaunched all works fine and the configuration reports correctly from launch.
Lately i've been getting a strange error that is attached to the currentIem property of my AVPlayer object.When changing from one playerItem to the next i load up the AVURLAsset asynchronously and setup the playerItem once it has loaded the asset. The AVPlayer's currentItem is replaced with the new one and occassionally I will get a AVPlayerStatusFailed on the playerItem. The Error has a domain of NSCocoaErrorDomain and a code 257 stating The file couldn't be opened because you don't have permission to view it.. I can then try the process again for the same file and it will work. Anyone else get that kind of error on the AVPlayerItem? Seems bizarre considering it works if you try it again. Files are stored in the app. The app shouldn't have a problem accessing files. Any tips welcome, thanks.