Re: CoreData, NSDocument and NSApplication
Re: CoreData, NSDocument and NSApplication
- Subject: Re: CoreData, NSDocument and NSApplication
- From: Chris Hanson <email@hidden>
- Date: Wed, 11 Oct 2006 10:44:45 -0700
Marc is on the right track. If you want to have a document-based
application where each document actually represents data from a shared
persistent store, one way to do it would be to have each document's
NSManagedObjectContext share a single NSPersistentStoreCoordinator.
If you want each of your documents to actually represent a query
that's archived to a file or something along those lines, I'd use
NSDocument instead of NSPersistentDocument, to avoid having to break
any assumptions the latter might be making. NSPersistentDocument
expects the file that it represents on disk to be a persistent store;
rather than trying to subvert that assumption, I'd just write the
couple lines of code to give each of my documents its own
NSManagedObjectContext and have it use the documents NSUndoManager.
-- Chris
_______________________________________________
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