magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.79k stars 1.79k forks source link

After solving iOS13, set NSPersistentCloudKitContainer #1380

Open Gensun opened 4 years ago

Gensun commented 4 years ago

for this: if (@available(iOS 13.0, )) { AppDelegate delegate = ((AppDelegate *)[UIApplication sharedApplication].delegate);

        [NSManagedObjectModel MR_setDefaultManagedObjectModel:delegate.persistentContainer.managedObjectModel];
        [NSManagedObjectContext MR_setRootSavingContext:delegate.persistentContainer.viewContext];
        [NSManagedObjectContext MR_setDefaultContext:delegate.persistentContainer.viewContext];

        [MagicalRecord setupCoreDataStackWithiCloudContainer:@"iCloud.com.zhimo.mathkid" contentNameKey:@"zhimo" localStoreNamed:@"" cloudStorePathComponent:@""];

}