使用这段代码,我可以将 persitentstore(核心数据)迁移到 iCloud:
NSPersistentStore *persistentStore = [[persistentStoreCoordinator persistentStores]objectAtIndex:0];
if(![persistentStoreCoordinator migratePersistentStore:persistentStore toURL:[NSURL fileURLWithPath:iCloudData] options:options withType:NSSQLiteStoreType error:&error])
{
NSLog(@"errore migrate %@", error);
}
但我只想在 iCloud 的 Ubiquity Container 为空且持久存储不存在的情况下迁移。
最佳答案
关于ios - 将持久存储迁移到 iCloud,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21003100/