Instantly share code, notes, and snippets.

Embed
What would you like to do?
Forcing true reset of managed object context
- (BOOL)hardResetContext:(NSManagedObjectContext *)context store:(NSPersistentStore *)store;
{
NSPersistentStoreCoordinator *storeCoordinator = [context persistentStoreCoordinator];
if (![storeCoordinator removePersistentStore:myStore error:NULL])
{
return NO;
}
return [storeCoordinator addPersistentStoreWithType:[store type]
configuration:nil
URL:[store URL]
options:nil
error:NULL];
}
@bafnaparag

This comment has been minimized.

Show comment
Hide comment
@bafnaparag

bafnaparag Jan 27, 2015

What will happen if you have strong reference to managed objects ?

bafnaparag commented Jan 27, 2015

What will happen if you have strong reference to managed objects ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment