• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
      • From: Todd Blanchard <email@hidden>
    • Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
      • From: mmalcolm crawford <email@hidden>
References: 
 >How to get NSPersistentDocument to use a subclassed NSManagedContext? (From: Todd Blanchard <email@hidden>)

  • Prev by Date: take pity on rank beginner
  • Next by Date: Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
  • Previous by thread: How to get NSPersistentDocument to use a subclassed NSManagedContext?
  • Next by thread: Re: How to get NSPersistentDocument to use a subclassed NSManagedContext?
  • Index(es):
    • Date
    • Thread