I am using NSPersistentCloudKitContainer and I decided to add a property to an entity. I accidentally ran try! container.initializeCloudKitSchema(options: []) while using the production container in Xcode (com.apple.developer.icloud-container-environment) which throw a couple of errors and created some FAKE_ records in my production container. So I changed to my development container and ran the try! container.initializeCloudKitSchema(options: []) and now it succeeded. After that I cleaned up the FAKE_ records scattered in production container but in Xcode when I'm running I now get these logs in the console (and I can't seem to get rid of them): error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _importFinishedWithResult:importer:](1398): : Import failed with error: Error Domain=NSCocoaErrorDomain Code=4864 *** -[NSKeyedUnarchiver _initForReadingFromData:error:throwLegacyExceptions:]: incomprehensible archive (0x53, 0x6f, 0x6d, 0x65, 0x20, 0x73, 0x61, 0x6d) UserInfo={NSDebugDescription=*** -[NS
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi everyone, I am a beginner in iOS/Swift programming. I'm trying to develop a mobile application that allows to mount a network drive in the iphone Files application via the WebDav protocol. I saw on the internet that WebDav is no longer implemented in iOS because considered deprecated by apple. To accomplish this task, I decided to separate responsibilities as follows: Framework: WebDav (responsible for communication with the WebDav server) FileProviderExtension: FileBridge (Responsible for bridging the gap between the WebDav Framework and the iOS Files app) Main App I also have an AppGroup that includes the main application and the fileproviderextension Initially, to measure the feasibility and complexity of this task, I'd like to make a simplistic version that simply displays the files on my drive in the Files app, without necessarily being able to interact with them. FileProviderExtension.swift: import FileProvider import WebDav class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension { p
After the release of StoreKit 2.0, the in-app purchase failure rate increased by 63.19%, with the majority of errors being StoreKitError.unknown. When encountering this error, many users repeatedly attempt to make a purchase, but the outcome remains unchanged, resulting in the same unknown error. In some cases, users who wait approximately 2 minutes before retrying the purchase may either succeed or encounter the following error: “StoreKit.StoreKitError.systemError(Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.storekitd”)”. This issue has directly impacted our app's purchasing flow. Because our app only displays the promotional purchase offer once, these issues have significantly reduced the number of users successfully completing the offer. As a result, the conversion rate for this promotion has dropped well below expectations, negatively impacting our business metrics.
When launching the SimpleWatchConnectivity sample in a simulator (iOS 18.2 + watchOS 11.2), almost all the functionality works, but TransferFile does not work. The error is the following: -[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer due to Error Domain=NSCocoaErrorDomain Code=4866 Caught exception during archival: This object may only be encoded by an NSXPCCoder. How can it be fixed or worked around?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Watch Connectivity
WatchKit
watchOS
Simulator
So I ran a promo for my app that got me 30k downloads or so. The app was free for a day and so it got lots of purchases. There were two errors from StoreKit2 that I can't explain (I'll detail the other one in another post) This one: StoreKit.StoreKitError.systemError(Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 19497 named com.apple.storekitd UserInfo={NSDebugDescription=connection to service with pid 19497 named com.apple.storekitd} There are various theories online that the display name of the purchase could be an issue. Another was that this indicates that this indicates that a helper process has crashed. Generally my guidance was to restart the device and that seemed to resolve it for most if not everyone. But not everyone reached out and it rained bad reviews and I was accused of a bait and switch and so on. Is there any way to mitigate this? Any way to address it? It doesn't happen for everyone but it happens very frequently still.
After updating to iOS 18.2, the issue I’ve been experiencing remains unresolved. To ensure the issue wasn’t related to the temporary folder permissions, I took the following steps: Created a custom temporary folder inside the app’s existing temporary folder. Used the UIDocumentPickerViewController to import a file and copied it into the newly created custom temporary folder. Unfortunately, this approach did not resolve the problem. Even after successfully copying the file into the custom folder, I am still unable to delete it. You have to understand that when I import a file using the UIDocumentPickerController, I expect the provided API to enable me to successfully copy the returned file into the app sandbox in such a way that I am then able to delete it. This operation appears to work correctly. do { let securityScoped = sourceItemURL.startAccessingSecurityScopedResource() try FileManager.default.copyItem(at: sourceItemURL, to: temporaryItemURL) print(INFO: Source item copied to temporary directory successf
Topic:
App & System Services
SubTopic:
Core OS
Tags:
[quote='815622022, floorish, /thread/764435?answerId=815622022#815622022, /profile/floorish'] I've received multiple confirmations that any of these solutions resolve the issue: Create a new user account (old account will stay bugged) Reset the macOS keychain for the (bugged) user account Update to 15.1+ [/quote] Thank you SO MUCH for this. I've spent a TON of time investigating why, after updating from Ventura to Sonoma, Final Cut Pro 11 was being so terribly SLOW ( mainly when opening libraries and when closing the app ), even though FCP 10.8.1 worked fine! A clue pointing me towards this thread popped up, when I tried to use HandBrake to transcode a video and have encountered the very same problems as in FCP. Handbrake's console listed the following: [09:30:49] macgui: Failed to create bookmark: Error Domain=NSCocoaErrorDomain Code=256 Failed to retrieve app-scope key UserInfo={NSDebugDescription=Failed to retrieve app-scope key} [09:30:49] macgui: Failed to create bookmark: Error Domain=NSCocoaErrorDomain
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I have an XCTest unit test that's running in an iOS host but with the My Mac (Designed For iPad) Target. Enabling mergeable libraries causes two errors: Symbol not found: _$s10Foundation3URLV9RVAPIPackE8isGCSURLSbvg And loading failed because of an error Error Domain=NSCocoaErrorDomain Code=3588 for the Test bundle because one of the frameworks that's supposed to be merged couldn't be loaded. Disabling mergeable libraries fixes it. It also works with mergeable libraries enabled but with a regular simulator target. So not sure if I'm missing something or if I need to disable mergeable libraries now:/
Your issue is that URL(string:) expects a valid URL with a scheme (like file://), but you're passing a file path directly. It is similar to the following error:ErrorDomain = NsCocoaErrorDomain & ErrorCode = 4 Instead, you should use URL(fileURLWithPath:) for file paths. Here's the fixed code: var tempString = String() for Rezept in alleRezepte { tempString += (Rezept.name), (Rezept.description), (Rezept.nutrients), (Rezept.whatToDo)n } if let dirs = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first { let path = dirs.appending(/rezepte.csv) let url = URL(fileURLWithPath: path) do { try tempString.write(to: url, atomically: true, encoding: .utf8) print(Daten gesichert) } catch { print(Error saving file: (error)) } }
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Hi there, I've encountered a file permission bug in iOS 18.1.1 when using FileManager.default.copyItem(at:to:) to copy files from an iCloud shared folder to the app sandbox. This issue occurs under the following conditions: The source file resides in an iCloud shared folder. The iCloud shared folder is owned by another iCloud user and shared with read-only permissions. The app copies the file to its sandbox using the copyItem(at:to:) method. Observed Behavior: After copying the file to the app sandbox, the original file's read-only permissions are propagated to the copied file. This results in an inability to delete the copied file from the app sandbox, with the following error message: NSCocoaErrorDomain, Code 513: The file couldn’t be removed because you don’t have permission to access it. Steps to Reproduce: Access a shared iCloud folder owned by another user with read-only permissions. Copy a file from this folder to the app sandbox using FileManager.default.copyItem(at:to:). Attempt to delete th
I think intermittently is a misnomer. It is sysem-dependent and consistently happening, just not on any of the systems in our control. To give additional context, we can see it existed in our postinstall check, but then at the end it says it can't find the file instead of PackageKit: Registered bundle ... but we can't find a message explaining why it is being removed. 2024-10-02 09:43:06-04 MBA-L-8114 package_script_service[9897]: ./postinstall: App Name: /Applications/.hiddenfolder/app1.app found. ... 2024-10-02 09:43:06-04 MBA-L-8114 package_script_service[9897]: PackageKit: Hosted team responsible for script has been cleared. 2024-10-02 09:43:06-04 MBA-L-8114 package_script_service[9897]: Responsibility set back to self. 2024-10-02 09:43:06-04 MBA-L-8114 installd[3215]: PackageKit: Writing receipt for com.company.pkg.app1 to / 2024-10-02 09:43:06-04 MBA-L-8114 installd[3215]: PackageKit: Touched bundle /Applications/HelperApp.app 2024-10-02 09:43:06-04 MBA-L-8114 installd[3215]: PackageKit: Touched bundle
Topic:
App & System Services
SubTopic:
Core OS
I am experiencing the same issue on Xcode 16.1 (16B40), when merged binary is enabled, erroring (redacted my library name with <>): | ================================== | | | CouldNotParseInput | | | | ================================== | | | | | FailedParsingMachObjectFile | | | | | | MachO data could not be parsed for: <> | | | Reason: Underlying failure reading data | | | Data header bytes: [] | | | Data header ASCII: | | | | | | ================================== | | | | | | | NSError.NSCocoaErrorDomain.260: The file “<>” couldn’t be opened because there is no such file. | | | | | | | | NSCocoaErrorDomain (260): | | | | ==NSURL: <> -- file:/// | | | | ==NSFilePath: /<> | | | | | | | | ================================== | | | | | | | | | NSError | | | | | | | | | | NSError: Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Both appleIDs(create and modify/save) sign in iCloud. I use the following code to modify and save records: self.containerIdentifier).publicCloudDatabase database.fetch(withRecordID: CKRecord.ID(recordName:groupID), completionHandler: { record, error in if error == nil && record != nil { if let iDs : [String] = record!.object(forKey: memberIDs) as? Array { if iDs.count < self.maxMemberCount { if let mems: [String] = record!.object(forKey: memberNames) as? Array { if !(mems as NSArray).contains(name) { var members = mems members.append(name) record!.setObject(members as CKRecordValue, forKey: memberNames) var iDs : [String] = record!.object(forKey: memberIDs) as! Array iDs.append(self.myMemberID) record!.setObject(iDs as CKRecordValue, forKey:memberIDs) database.save(record!, completionHandler: { record, error in if error == nil { } else { completion(error as NSError?) dPrint(Error : (String(describing: error))) } }) }else{ let DBError : NSError = NSError(domain: DBError, code: 89, userInfo: [localiz
Topic:
App & System Services
SubTopic:
iCloud & Data
I see this error in the debugger: #FactoryInstall Unable to query results, error: 5 IPCAUClient.cpp:129 IPCAUClient: bundle display name is nil Error in destroying pipe Error Domain=NSCocoaErrorDomain Code=4099 The connection from pid 5476 on anonymousListener or serviceListener was invalidated from this process. UserInfo={NSDebugDescription=The connection from pid 5476 on anonymousListener or serviceListener was invalidated from this process.} on this function: func speakItem() { let utterance = AVSpeechUtterance(string: item.toString()) utterance.voice = AVSpeechSynthesisVoice(language: en-GB) try? AVAudioSession.sharedInstance().setCategory(.playback) utterance.rate = 0.3 let synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) } When running without the debugger, it will (usually) speak once, then it won't speak unless I tap the button that calls this function many times. I know AVSpeech has problems that Apple is long aware of, but I'm wondering if anyone has a work around. I was thi
Hi, I am implementing the synchronisation of SwiftData with CloudKit as described in the Apple Documentation titled - Syncing model data across a person’s devices. My app runs fine on iPhone without activating CloudKit under Signing and Capabilities option. But when activated, I get a CoreData error with a code: 134060. My app is in development stage. The following is the code snippet for your reference taken from the main structure adopting the App protocol. init() { do { #if DEBUG let schema = Schema([ Debit.self, Credit.self, ]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) // Use an autorelease pool to make sure Swift deallocates the persistent // container before setting up the SwiftData stack. try autoreleasepool { let desc = NSPersistentStoreDescription(url: modelConfiguration.url) let opts = NSPersistentCloudKitContainerOptions(containerIdentifier: iCloud.com.sureshco.MyFirstApp) desc.cloudKitContainerOptions = opts // Load the store synchronously so it compl