Saving a CKRecord
in the simulator gives me the following error:
[publicDatabase saveRecord:cloudRouteEntity completionHandler:^(CKRecord *record, NSError *error) {
if (error) {
NSLog(@"An error occured in %@: %@", NSStringFromSelector(_cmd), error);
abort();
}
else {
dispatch_async(dispatch_get_main_queue(), ^(void) {
//GUI
NSLog(@"Created Cloudkit Entity");
});
}
}];
However, it works on the phone. Why does the simulator not have access to the CloudKit database?
EDIT: I thought I'd be clever by adding the iCloud account to the simulator - but iCloud moans that this is not allowed on "this device" (simulator). Ideas anyone?
I got the same problem, which I was able to resolve by logging in to my iCloud account in the simulator (Settings > iCloud).
As of the latest Xcode, you can log in to your iCloud account in the simulator, and everything should work.
If you are having trouble logging in, try to go to iCloud.com on a desktop and log in there first. Once that is set up properly, then try in the simulator.
I'm seeing the same error. According to the discussion linked below the cause might be two-factor authentication.
https://discussions.apple.com/thread/6588883
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With