You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to check if an app update brought a new Core Data model version. If so, I'd like to migrate the cloud data, disable iCloud and work offline then. In particular:
manually migrate the cloud store in ubiquityStoreManager:willLoadStoreIsCloud: to the new model version
migrateCloudToLocal
setCloudEnabled = NO (step 2 does this already automatically)
or in code:
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore
{
if (isCloudStore)
{
NSURL *cloudStoreURL = manager.URLForCloudStore; // WRONG: gives ubiquity directory, not an sql fileif ([selfisMigrationNeededForSourceStoreURL:cloudStoreURL])
{
[selfmigrateStoreToCurrentModel:cloudStoreURL];
[manager migrateCloudToLocal]; // This will also set iCloud disabled
}
}
}
My problem is that I cannot do the manual migration without knowing the URL to the persistent store file (sqlite). When ubiquityStoreManager:willLoadStoreIsCloud: is called there's no store coordinator which can tell me where the file is or which cloud store file to use.
Also, can I call migrateCloudToLocal within ubiquityStoreManager:willLoadStoreIsCloud:?
The text was updated successfully, but these errors were encountered:
I'd like to check if an app update brought a new Core Data model version. If so, I'd like to migrate the cloud data, disable iCloud and work offline then. In particular:
ubiquityStoreManager:willLoadStoreIsCloud:
to the new model versionmigrateCloudToLocal
setCloudEnabled = NO
(step 2 does this already automatically)or in code:
My problem is that I cannot do the manual migration without knowing the URL to the persistent store file (sqlite). When
ubiquityStoreManager:willLoadStoreIsCloud:
is called there's no store coordinator which can tell me where the file is or which cloud store file to use.Also, can I call
migrateCloudToLocal
withinubiquityStoreManager:willLoadStoreIsCloud:
?The text was updated successfully, but these errors were encountered: