I am using MagicalRecord framework to “clean up” Core Data code. When the app launch or resume from background, the program will try to clean up some data with the following code:
[MagicalRecord saveWithBlock:^(NSManagedObjectContext localContext) {
NSDate date = [[NSDate date] dateByAddingTimeInterval:-259200];
}];
The entity "NGCOwner" has 17 relationships and set the delete rule to Cascade. When the program delete the NGCOwner entity (approx. 170 NGCOwner), it makes the NSPersistentStoreCoordinator busy and freeze the app.
Can I force NSPersistentStoreCoordinator not to execute in main thread?
http://stackoverflow.com/questions/37787092/ios-app-freeze-when-delete-entity-with-magical-record
I am using MagicalRecord framework to “clean up” Core Data code. When the app launch or resume from background, the program will try to clean up some data with the following code:
[MagicalRecord saveWithBlock:^(NSManagedObjectContext localContext) { NSDate date = [[NSDate date] dateByAddingTimeInterval:-259200];
}]; The entity "NGCOwner" has 17 relationships and set the delete rule to Cascade. When the program delete the NGCOwner entity (approx. 170 NGCOwner), it makes the NSPersistentStoreCoordinator busy and freeze the app.
Can I force NSPersistentStoreCoordinator not to execute in main thread?