Created
August 16, 2011 22:49
-
-
Save NZKoz/1150383 to your computer and use it in GitHub Desktop.
Core Data API Weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// constructor returns object which is useless till you do some other stuff | |
NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; | |
// The context is 'initialized' but completely useless till this next line executes. | |
context.persistentStoreCoordinator = coordinator; | |
// returned object is immediately useful and API nicely encapsulated | |
NSManagedObjectContext *context = [coordinator newManagedObjectContextWithConcurrencyType:NSPrivateQueueConcurrencyType]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment