> On 3 Feb 2015, at 04:25, Steve Mills <sjmi...@mac.com> wrote:
> 
> On Jan 31, 2015, at 12:00:03, Jerry Krinock <je...@ieee.org> wrote:
>> 
>> 
>> 
>> I liked this one [1] by Aaron Douglas (all in Swift) when I was needed to do 
>> a presentation on Core Data last September.  And then, in a rage of NIH [2], 
>> I wrote my own [3] instead, in Objective-C.  The one Swift alternative file 
>> in there is still untested :))
>> 
>> Finally, always check Ray Wenderlich’s site [4] when you want sample code.
>> 
>> 1.  
>> https://github.com/astralbodies/CoreDataConcurrencyDemo/tree/master/CoreDataConcurrencyDemo
>> 2.  http://en.wikipedia.org/wiki/Not_invented_here
>> 3.  https://github.com/jerrykrinock/YaBT-Yet-another-Bug-Tracker
>> 4.  http://www.raywenderlich.com
> 
> I'm having a hard time figuring out how to make this work with an 
> NSPersistentDocument. All the examples I've looked at are for iOS, so they 
> all set up their own complete Core Data stack. What I'm trying to do - based 
> on these examples - is to override the document's managedObjectContext 
> method, which is where I'll create the NSMainQueueConcurrencyType MOC, and 
> set its parent to the NSPrivateQueueConcurrencyType "root" MOC. But in order 
> to create the root MOC, I need to get at the NSPersistentDocument's 
> NSPersistentStoreCoordinator, but there is no method or property to get at 
> that. Do I just create my own NSPersistentStoreCoordinator instead, like the 
> iOS examples do?
> 
> --
> Steve Mills
> Drummer, Mac geek


get the NSManagedObjectContext the document creates for you with [ super 
managedObjectContext ], get the store coordinator with [ managedObjectContext 
persistentStoreCoordinator ], create your own MOCs on that store, hold on to 
the MOC you have just created, ignore the one super created (or perhaps you can 
nil it, not sure) and then return it. 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to