ObjectiveRecord icon indicating copy to clipboard operation
ObjectiveRecord copied to clipboard

CoreDatamanager sharedInstance managedObjectContext init as a MainContext type ?

Open ClarisseL opened this issue 13 years ago • 4 comments

Hello,

This is really more a question than an issue, I was wondering how you were using this method [[CoreDatamanager sharedInstance] managedObjectContext], I always use it as the main context, so I was wondering if it was meant to be used like that and if it is, then maybe it would make sense to create it like that :

_managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];

instead of simply "init" ?

ClarisseL avatar Oct 12 '13 16:10 ClarisseL

@ClarisseL you're totally right. Feel free to submit a PR and I'll merge it in.

To answer your usage question, I do rarely use it directly like that. There's a small helper method [NSManagedObjectContext defaultContext] that basically points to the same thing.

supermarin avatar Oct 12 '13 17:10 supermarin

Oh ok I didn't know about about that method, I started using your awesome library a few days ago ^_^, I changed it locally but have no idea how to actually commit it :/ I really don't know much about git (But I'' try to have figured it out before tonight :P)!

ClarisseL avatar Oct 12 '13 17:10 ClarisseL

Ok It seemed pretty easy, I sent the pull request ! :D my very first very proud!

ClarisseL avatar Oct 12 '13 17:10 ClarisseL

Awesome! Thanks

supermarin avatar Oct 13 '13 00:10 supermarin