• 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: Bypassing Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bypassing Interface Builder


  • Subject: Re: Bypassing Interface Builder
  • From: Andy Lee <email@hidden>
  • Date: Wed, 14 May 2008 21:02:26 -0400

On May 14, 2008, at 8:45 PM, Graham Cox wrote:
On 15 May 2008, at 10:15 am, Johnny Lundy wrote:
Also, the documentation only says about File's Owner that it is the object that loaded the nib file. What is that object, if my nib file just gets loaded at application launch?

It depends. It's the file's (nib's) owner. If you are talking about MainMenu.nib, its owner is the application instance. For typical document nibs, it's the NSDocument instance. For others, it's whatever you pass as "owner" in the NSBundle class method +loadNibNamed:owner:

You may not be aware that you can create nibs that are *not* loaded at application launch, but only when you use +loadNibNamed:owner:. For example, you might put resources for your application's About box in a separate nib that is only loaded when the user chooses "About..." from the menu. This would speed up launch time slightly and would avoid allocating memory for the About box until absolutely necessary.


Note also that you can load a nib file multiple times, and each time a brand new set of objects will be instantiated and interconnected using the object descriptions in the nib file. NSDocument-based applications use this fact when you create a new document.

--Andy

_______________________________________________

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: 
 >Re: Bypassing Interface Builder (From: Johnny Lundy <email@hidden>)
 >Re: Bypassing Interface Builder (From: Graham Cox <email@hidden>)

  • Prev by Date: cross-development Problems
  • Next by Date: Re: Bypassing Interface Builder
  • Previous by thread: Re: Bypassing Interface Builder
  • Next by thread: Re: Bypassing Interface Builder
  • Index(es):
    • Date
    • Thread