CKFetchRecordZoneChangesOperation breaks NSPersistentCloudKitContainer when called inside AppDelegate?

I'm trying to call CKFetchRecordZoneChangesOperation to get the latest changes from the shared database.


But when I run that operation from inside didFinishLaunchingWithOptions, NSPersistentCloudKitContainer will break. It will save to coredata, but it will no longer sync to Cloudkit. It's as if it's paused. When I restart the app, the sync resumes.


But if I call CKFetchRecordZoneChangesOperation later in the app lifecycle, say in viewDidLoad, everything works fine. Why is this?

Replies

Who is the delegate in teh case of calling from the AppDelegate? Who is the delegate in the case of calling from viewDidLoad?