• 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: Converting to NSPersistentDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting to NSPersistentDocument


  • Subject: Re: Converting to NSPersistentDocument
  • From: Steven Hamilton <email@hidden>
  • Date: Thu, 19 Jun 2008 19:38:08 +1000


On 16/06/2008, at 5:42 AM, Hamish Allan wrote:

On Sun, Jun 15, 2008 at 11:42 AM, Steven Hamilton <email@hidden> wrote:

I've been a busy bee learning Cocoa and core data (as my frequent postings
may reveal) and now I wish to add NSPersistentDocument functionality. I
started my project using the normal Core Data template so how do I change my
program to use the NSPersistentDocument model instead of the standard bare
Core Data template?

That would depend on what you mean by "add NSPersistentDocument functionality". Usually, the VC of the MVC will be different enough in a document-based app as opposed to a non document-based app that it will be easier and cleaner to just create a new document-based project and copy the files for those parts of the model (and maybe controller) you wish to remain the same.

Righty. I've read up Document based architecture and through the NSPersistentDocument tutorial and class references. I've decided to do as you say and create a new project and sutbly move my code and nib files over. Since my document is multi-window based I need to subclass NSDocument (done) and NSWindowControllers, one controller for each window in the document. So far so good. What I don't understand is how to bind to the managedObjectContext. As far as I can tell in each windows .nib file I set File's Owner to be my subclassed WindowController. This doesn't contain the MOC so therefore I can't bind to it. NSDocument has the MOC but that isn't available in the list of bindable objects.
Do I have the design wrong here? Should I set my subclassed windowcontrollers to be each nibs FilesOwner? How do I reach the managedObjectContext?
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Converting to NSPersistentDocument
      • From: mmalc Crawford <email@hidden>
References: 
 >Converting to NSPersistentDocument (From: Steven Hamilton <email@hidden>)
 >Re: Converting to NSPersistentDocument (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: Re: Binding the enabled property of a NSMatrix instance to wether or not a multiple selection on a array controller is made.
  • Next by Date: Re: Converting to NSPersistentDocument
  • Previous by thread: Re: Converting to NSPersistentDocument
  • Next by thread: Re: Converting to NSPersistentDocument
  • Index(es):
    • Date
    • Thread