Re: Confusion about NIB loading
Re: Confusion about NIB loading
- Subject: Re: Confusion about NIB loading
- From: Kevin Cathey <email@hidden>
- Date: Wed, 24 Jun 2009 17:33:54 -0700
Alternatively you could use NSNib which allows you to explicitly
specify the bundle. In addition, when instantiating the nib using
NSNib, you can get the top level objects to send a release message to
match the implicit retain. For more info, check out the resource
programming guide:
http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW28
Kevin
On 24 Jun 2009, at 17:18, Chris Idou wrote:
On 24/06/2009, at 11:20 PM, Chris Idou wrote:
Since the doco for loadNibNamed:owner: says that it looks in the
bundle "associated"
with the owner, I'm creating an object of a class that exists in
the subframework to pass as the owner.
However, it doesn't find the NIB. Am I understanding correctly
what it means
for a bundle to be "associated" with a class?
To get the bundle for the class, you need to use [NSBundle
bundleForClass:[YourClass class]]. You can then load the nib by
calling loadNibNamed:owner:.
But loadNibNamed:owner: is a class method, so I can't actually
explicitly find the appropriate bundle, and call loadNibNamed: on it
to find the right NIB.
The doco says that loadNibNamed:owner: will look in the bundle
"associated" with the owner, but passing in an object of a class in
the appropriate Bundle doesn't seem to work for me.
Access Yahoo!7 Mail on your mobile. Anytime. Anywhere.
Show me how: http://au.mobile.yahoo.com/mail
_______________________________________________
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
_______________________________________________
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