Re: Bypassing Interface Builder
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