Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Foundation model sandbox restriction error
I'm seeing this error a lot in my console log of my iPhone 15 Pro (Apple Intelligence enabled): com.apple.modelcatalog.catalog sync: connection error during call: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.modelcatalog.catalog was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.modelcatalog.catalog was invalidated: failed at lookup with error 159 - Sandbox restriction.} reached max num connection attempts: 1 Are there entitlements / permissions I need to enable in Xcode that I forgot to do? Code example Here's how I'm initializing the language model session: private func setupLanguageModelSession() { if #available(iOS 26.0, *) { let instructions = my instructions do { languageModelSession = try LanguageModelSession(instructions: instructions) print(Foundation Models language model session initialized) } catch { print(Error creating language model session: (error)) lang
2
0
212
Jun ’25
ShieldConfigurationExtension & SwiftData
Hi, I am developing a Screen Time App and I am having issues with the ShieldConfigurationExtension (ShieldConfigurationDataSource). I know this extensions is sandboxed but I should be able to read data from the main app. I am using SwiftData as my database, but I am unable to initialize it in the extensions with an error indicating insufficient file permissions. I have App Group set up and I am able to share data using UserDefaults but that is just inconvenient. Is there any way I could just open the SwiftData in read only mode so that I could display the user some info on the shield? SwiftData Init: private func setupContainer() throws { let schema = Schema([ DogEntity.self, HouseEntity.self ]) // Use app group container if available let config: ModelConfiguration if let containerURL = FileManager.default.containerURL( forSecurityApplicationGroupIdentifier: group.(Bundle.app.bundleIdentifier ?? ) ) { config = ModelConfiguration(schema: schema, url: containerURL.appendingPathComponent(default.sqlite)) } else
1
0
180
May ’25
iCloud sync issues using NSPersistentCloudKitContainer for Core Data + CloudKit sync.
I have tried to set up iCloud sync. Despite fully isolating and resetting my development environment, the app fails with: NSCocoaErrorDomain Code=134060 (PersistentStoreIncompatibleVersionHashError) What I’ve done: Created a brand new CloudKit container Created a new bundle ID and app target Renamed the Core Data model file itself Set a new model version Used a new .sqlite store path Created a new .entitlements file with the correct container ID Verified that the CloudKit dashboard shows no records Deleted and reinstalled the app on a real device Also tested with “Automatically manage signing” and without Despite this, the error persists. I am very inexperienced and am not sure what my next step is to even attempt to fix this. Any guidance is apprecitated.
1
0
189
May ’25
XPC Connection Error
I have an accessory with MFi authenticaiton passed(got 0xAA05) and identification accepted (got 0x1D02). But when I try to open the target stream by using iAP2 EA session framework, I always enounter the same error looking like: XPC connection error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.accessories.externalaccessory-server was invalidated from this process. UserInfo={NSDebugDescription=The connection to service named com.apple.accessories.externalaccessory-server was invalidated from this process.} anybody can tell me what it related with? And what can I do to go through it quickly? Thank you much in advance.
1
0
145
May ’25
LaunchAgent can't connect to CloudKit daemon
For this code: let status = try await container.accountStatus() Seeing this error: 2025-05-08 15:32:00.945731-0500 localhost myAgent[2661]: (myDaemon.debug.dylib) [com.myDaemon.cli:networking] Error Domain=CKErrorDomain Code=6 Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error. UserInfo={NSLocalizedDescription=Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and more. Check the logs around this time to investigate the cause of this error., CKRetryAfter=5, CKErrorDescription=Error connecting to CloudKit daemon. This could happen for many reasons, for example a daemon exit, a device reboot, a race with the connection inactivity monitor, invalid entitlements, and mo
3
0
184
May ’25
Reply to Xcode 16.3 / macOS 15.4: SwiftData ModelContainer 在关联 iCloud Container 后初始化时崩溃
When you create a ModelConfiguration, the default value of the cloudKitDatabase attribute .automatic, which tells SwiftData to enable CloudKit synchronization using the primary CloudKit container from the app’s entitlements. That is why you see that SwiftData automatically picks up the CloudKit container, if you configure one in your project, and enables CloudKit integration. If you don't like the default behavior, pass .none when you create the model configuration. Assuming that you use the Xcode template code to trigger the crash, most likely, you will see the following message in your Xcode console: Unresolved error loading container Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={NSLocalizedFailureReason=CloudKit integration requires that all attributes be optional, or have a default value set. The following attributes are marked non-optional but do not have a default value: Item: timestamp} The log makes clear that the failure is triggered because Item: timestam
Apr ’25
Unable to Write to App Group Shared Container on Device
Hi everyone, I'm facing an issue where I cannot write a file to a shared App Group container in my tvOS app when running on a real device. My code works perfectly on the simulator, but fails on a physical device with a permissions error. I’ve set up an App Group with a custom identifier (e.g., group.), and it’s correctly configured in the Capabilities section of Xcode for both my main app and widget targets. Here’s the code I’m using to save a test file: func saveTestFile() { guard let groupURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: group.) else { print(Couldn't access the Group URL.) return } let containerURL = groupURL.appendingPathComponent(Library, isDirectory: true) if FileManager.default.isWritableFile(atPath: containerURL.path) { print(Directory IS writable) } else { print(Directory IS NOT writable) } let fileURL = containerURL.appendingPathComponent(test.txt) let content = Hello App Group! do { try content.write(to: fileURL, atomically: true, encoding: .utf8) print(F
1
0
153
Apr ’25
Unable to start a live activity
I'm unable to get live activity to show up in my app so I started to play with the demo app Emoji Rangers. The demo project initially only created a live activity in-app and then you're able to update it via the demo buttons. I added the following code to have it be able to start a live activity from the backend: func observePushToStartToken() { Task { for await data in Activity.pushToStartTokenUpdates { let token = data.map {String(format: %02x, $0)}.joined() // Send token to the server print(got PUSHTOSTART TOKEN: (token)) } } } I get the token and then I use it to send this payload that should start the activity: { aps:{ timestamp:1743719911, event:start, content-state:{ currentHealthLevel:100, eventDescription:Adventure has begun!, supercharged:true }, input-push-token:1, attributes-type:AdventureAttributes, attributes:{ currentHealthLevel:100, eventDescription:Adventure has begun!, supercharged:true }, alert:{ title:{ loc-key:%@ is on an adventure!, loc-args:[ Power Panda ] }, body:{ loc-key:%@ found a s
1
0
72
Apr ’25
Reply to Security scoped bookmarks not valid anymore in macOS 14.7.5 / 13.7.5
Thank you for looking into it, very much appreciated. I'm not sure if the errors from the logs you posted are related to the underlying issue. Those same error/exception logs always show up when resolving the first bookmark after app launch, regardless of whether that bookmark resolves/fails. And they also show up on macOS 15. Here are the debug logs for a bookmark that was created before updating to 14.7.5: default 11:20:08.512031+0200 Resolving bookmark: debug 11:20:08.512159+0200 bookmarkRef=<0x600001b2c660 > options=0x400 relativeToURL=(null) propertiesToInclude=(null) repIsStaleP=0x16db12a58 errorRefP=0x16db12898 debug 11:20:08.512214+0200 Client beginning scoped bookmark resolution. debug 11:20:08.512233+0200 Resolution request message is prepared and about to be sent to the agent. debug 11:20:08.512612+0200 0x6000036935c0 rule ^Contents$ added (weight 0, flags 0x12) debug 11:20:08.512650+0200 0x6000036937a0 rule ^(.LSOverride|.DS_Store|Icon |.SoftwareDepot.tracking)$ added (weight 0, flags
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’25
Reply to iOS 18.4 and getFileProviderServicesForItem
Tested on iOS 18.5, Beta 1 (22EF5042g), same issue is still present. getFileProviderServicesForItem fails when called from the consuming app with: Error Domain=NSCocoaErrorDomain Code=513 The file couldn’t be saved because you don’t have permission. The supportedServiceSources method in the service hosted by the provider app is never invoked when this occurs.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’25
Security scoped bookmarks not valid anymore in macOS 14.7.5 / 13.7.5
Security scoped bookmarks that were created before updating to macOS 14.7.5 cannot be resolved anymore after updating to macOS 14.7.5. Reproduction: Sandboxed app on macOS version 14.7.4 Create and store a security scoped bookmark to a user selected folder: let url: URL = let data = try url.bookmarkData(options: [.withSecurityScope], includingResourceValuesForKeys: nil, relativeTo: nil) Update to macOS 14.7.5 Resolve the previously stored bookmark: let data: Data = var stale: Bool = true let url = try URL(resolvingBookmarkData: data, options: [.withSecurityScope], relativeTo: nil, bookmarkDataIsStale: &stale) Expected: The bookmark is resolved correctly and the resulting url can be used to access the folder/file in the sandboxed app after starting access. Observed: URL(resolvingBookmarkData:) throws an error: Error Domain=NSCocoaErrorDomain Code=259 The file couldn’t be opened because it isn’t in the correct format. New security scoped bookmarks created on macOS 14.5.7 can be resolved without
12
0
273
Apr ’25
iOS 18.4 and getFileProviderServicesForItem
I support a pair of iOS apps that use a file provider extension. One app exposes a file provider extension, including a file provider extension service and the other app interacts with the file provider extension and uses the service. On iOS 18.3 and before, this all works fine. On iOS 18.4, getFileProviderServicesForItem fails when called from the consuming app with: Error Domain=NSCocoaErrorDomain Code=513 The file couldn’t be saved because you don’t have permission. The supportedServiceSources method in the service hosted by the provider app is never invoked when this occurs. Is there some change to the mechanism for iOS 18.4 that I've not found yet?
5
0
347
Apr ’25
Safari Web Extensions & NSXPCConnection
I have a basic setup following WWDC 2020 on Safari Web Extensions and another one on XPC. The video even mentions that one can use UserDefaults or XPC to communicate with the host app. Here is my setup. macOS 15.2, Xcode 16.2 A macOS app (all targets sandboxed, with an app group) with 3 targets: SwiftUI Hello World web extension XPC Service The web extension itself works and can update UserDefaults, which can then be read by SwiftUI app - everything works by the book. The app can communicate to the XPC service via NSXPCConnection - again, everything works fine. The problem is that the web extension does not communicate with XPC, and this is what I need so that I can avoid using UserDefaults for larger and more complex payloads. Web Ext handler code: class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { func beginRequest(with context: NSExtensionContext) { // Unpack the message from Safari Web Extension. let item = context.inputItems[0] as? NSExtensionItem let message = item?.userInfo?[SFExte
6
0
366
Mar ’25
What is com.apple.TextInput.rdt?
Hello, community, I'm using an HTML editor in a .NET MAUI application running on macOS, and I'm encountering some unexpected behavior during text editing: Double-click text selection disappears after approximately one second. Styles randomly revert or are applied to the wrong text unexpectedly. It appears to be related to macOS spell checking. When using editable elements (, or with contenteditable), the system enables spell checking by default. During this, MAUI attempts to communicate with a system process: com.apple.TextInput.rdt, which is not running, leading to repeated errors like: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.TextInput.rdt was invalidated: failed at lookup with error 3 - No such process. Question: What is com.apple.TextInput.rdt, and why might it not be running? Thank you for any help!
2
0
149
Mar ’25