• 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: Sharing a model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sharing a model


  • Subject: Re: Sharing a model
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 13 Feb 2011 22:35:35 -0800

On Sun, Feb 13, 2011 at 9:27 PM, Graham Cox <email@hidden> wrote:
>> 3. When should the reference to the model be set up in each controller?
>
> It will be done for you when the document is created from the nib. All you need to do is populate the model from the file when the file is opened. NSDocument provides an override for that.

I think it's worth being pedantic here, given some recent confusion:

The document itself (your NSDocument instance) doesn't live in the
nib. It will *load* its nib, or an NSWindowController will do so on
its behalf. But it will already exist before the nib is unfrozen.

Sometimes people get confused and drop an NSDocument instance into the
nib window, thinking that it should be created along with the rest of
the document-related objects. Then they wind up with two NSDocument
instances, one of which is hooked up to all the interface objects and
controllers, while NSDocumentController only knows of the other one.

--Kyle Sluder
_______________________________________________

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

References: 
 >Sharing a model (From: Scott Steinman <email@hidden>)
 >Re: Sharing a model (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Sharing a model
  • Next by Date: Re: Sharing a model
  • Previous by thread: Re: Sharing a model
  • Next by thread: Re: Sharing a model
  • Index(es):
    • Date
    • Thread