• 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: CoreData, NSDocument and NSApplication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CoreData, NSDocument and NSApplication (From: Andrew Bush <email@hidden>)
 >Re: CoreData, NSDocument and NSApplication (From: Marc Respass <email@hidden>)

  • Prev by Date: Re: Core Data Applications
  • Next by Date: Re: Using CoreData as disconnected cache (Populating CoreData programmatically)
  • Previous by thread: Re: CoreData, NSDocument and NSApplication
  • Next by thread: Programmatically adding objects to a bound outlineview
  • Index(es):
    • Date
    • Thread