Posts

Post not yet marked as solved
9 Replies
1.9k Views
I have a few apps that use Core Data & CloudKit to sync data to multiple devices. Everything was fine until I updated to Xcode 14. Now, although the apps work on an actual device, in the simulator, I get errors about "Failed to sync user keys" and it won't sync anything. I haven't changed the code at all. It just suddenly won't work in the simulator. Since it does this for all apps, I have to believe it's something changed with the simulator? 2022-09-13 12:47:26.766223-0400 Time Since[8061:88974] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1134): <NSCloudKitMirroringDelegate: 0x600003b540e0>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x1219071d0> (URL: file:///Users/jon/Library/Developer/CoreSimulator/Devices/1990772E-CDF1-4A58-B454-E09D327B2182/data/Containers/Data/Application/3314EA95-4D86-4053-84B3-F1523A57E204/Library/Application%20Support/TimeSince.sqlite) <CKError 0x600000cc1e60: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: { com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600000cc2160: "Internal Error" (1/5000); "Failed to sync user keys"> }>
Posted
by bss.
Last updated
.
Post not yet marked as solved
10 Replies
13k Views
Trying to submit my app to TestFlight. I am getting stuck with a missing private key error. What's weird is that the private key does exist. I can see it in KeyChain. I've only ever used one Mac for development, so it's not like I need to get it form another machine. I tried revoking the cert, and deleting all the Apple Distribution certs/keys from my Keychain. Then I went through the Distribute App process again. Xcode offered to generate a distribution cert for me. I did that. It appears to have created two of them? One looks normal, but the second one is grayed out and says "Not in keychain". The "missing private key" error says I have one Apple Distribution certificate but its private key is not installed. Contact the creator of this certificate to get a copy of the private key. I've looked at a bunch of discussion posts and StackOverflow posts about this, but nothing seems to apply to my specific issue. At least, I tried all those techniques and nothing seems to work. How do I get around this?
Posted
by bss.
Last updated
.
Post not yet marked as solved
2 Replies
563 Views
I'm building a CloudKit app, and I'm trying to get a subscription working for the iOS app. Subscriptions work in the web app. This code gives me a "Request failed with http status code 503". myContainerId is the container ID in CloudKit Dashboard. &#9;&#9;&#9;&#9;let predicate = NSPredicate(value: true) &#9;&#9;&#9;&#9;let subscription = CKQuerySubscription(recordType: "Task", predicate: predicate, subscriptionID: "ios-tasks", options: [ CKQuerySubscription.Options.firesOnRecordCreation, CKQuerySubscription.Options.firesOnRecordUpdate, CKQuerySubscription.Options.firesOnRecordDeletion]) &#9;&#9;&#9;&#9;subscription.zoneID = CKRecordZone.ID(zoneName: "com.apple.coredata.cloudkit.zone", ownerName: CKCurrentUserDefaultName) &#9;&#9;&#9;&#9;let info = CKSubscription.NotificationInfo() &#9;&#9;&#9;&#9;info.shouldSendContentAvailable = true &#9;&#9;&#9;&#9;subscription.notificationInfo = info &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;let aContainer = CKContainer(identifier: myContainerId) &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;let operation = CKModifySubscriptionsOperation(subscriptionsToSave: [subscription], subscriptionIDsToDelete: []) &#9;&#9;&#9;&#9;operation.modifySubscriptionsCompletionBlock = { (sub, subIds, error) in &#9;&#9;&#9;&#9;&#9;&#9;guard error == nil else { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if let error = error { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;print("error while saving subscription: \(error.localizedDescription)") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;&#9;&#9;print("Saved subscription!") &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;operation.qualityOfService = .utility &#9;&#9;&#9;&#9;aContainer.privateCloudDatabase.add(operation) I'm primarily using an NSFetchedResultsController, and that's working great. When I go to CloudKit Dashboard, I see entities stored in my private database under the com.apple.coredata.cloudkit.zone zone. I'm guessing this is a configuration issue or something?
Posted
by bss.
Last updated
.
Post not yet marked as solved
1 Replies
696 Views
I'm trying to update an existing record. I have a record I got back from a previous query. It has a valid recordName, and recordChangeTag. When I pass that record to either newRecordsBatch().update or saveRecords I get the error in the subject. I ran across an old post from 4 years ago that said something about defining the ZoneID on the record, but I already have that defined from the query. It's using com.apple.coredata.cloudkit.zone.
Posted
by bss.
Last updated
.
Post marked as solved
3 Replies
5.7k Views
Xcode 11.3.1 on Mojave. Everything was fine until about half an hour ago when the delete key on my keyboard suddenly stopped working. It works in other apps, just not Xcode. It's the built-in keyboard on the MBP. Tried quitting and restarting Xcode, rebooting the Mac. It's really bizarre. When I hit delete, nothing happens, but then I will get a mesage that there is an invalid character in source file. If I click that, it offers to replace '' wtih ' '.I copied the text into BBEdit and looked at it, and it appears it's inserting ASCII 0x08, which is backspace. Cmd-delete will delete the line, and option-delete will delete the word. It's really hard to code with no delete key!
Posted
by bss.
Last updated
.
Post marked as solved
4 Replies
1k Views
I recently switched to Swift 4. My app has a service which works off the list of selected Finder items.I used to get a list of selected Finder items withlet fileArray : [String] = pboard.propertyList(forType: NSFilenamesPboardType) as! [String]With Swift 4, I now get this error:'NSFilenamesPboardType' is unavailable in Swift: use 'PasteboardType.fileURL'So I replace this withlet fileArray : [String] = pboard.propertyList(forType: .fileURL) as! [String]But at runtime, I get this:Could not cast value of type '__NSCFString' (0x7fffa9f86378) to 'NSArray' (0x7fffa9f87db8).How do I get around this? Is it no longer an array that comes back?
Posted
by bss.
Last updated
.