Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
- Subject: Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 22 May 2005 21:45:05 -0700
On May 22, 2005, at 9:13 PM, Todd Blanchard wrote:
I've been digging, literally for about 6 hours trying to get a
clear understanding of NSPersistentDocument's initialization process.
I have a subclass of NSManagedContext that I want my subclass of
NSPersistentDocument to use.
Where is the good place to arrange for the NSPersistentDocument to
get my subclass?
I suppose I could use posing, but I'd prefer something more
straightforward.
Per the documentation:
"You can customize the architecture of the persistence stack by
overriding the methods managedObjectModel and
configurePersistentStoreCoordinator:forURL:ofType:error:."
- (NSManagedObjectContext *)managedObjectContext
{
if (myManagedObjectContext == nil) {
myManagedObjectContext = [[MyManagedObjectContext alloc] init];
NSPersistentStoreCoordinator *psc =
[[NSPersistentStoreCoordinator alloc]
initWithManagedObjectModel:[self managedObjectModel]];
[myManagedObjectContext setPersistentStoreCoordinator:psc];
}
return myManagedObjectContext;
}
Also, where do I specify which kind of repository to use when using
NSPersistentDocument?
<http://developer.apple.com/documentation/Cocoa/Conceptual/
NSPersistentDocumentTutorial/02_CreatingProj/chapter_3_section_5.html>
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden