On 25/06/2009, at 10:18 AM, Chris Idou wrote:

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.


You can do the following:

NSBundle* bundle=[NSBundle bundleForClass:[YourClass class]];
                
//load the nib
[bundle loadNibFile:@"NibName" externalNameTable:[NSDictionary dictionaryWithObject:yourObjectInstance forKey:@"NSOwner"] withZone: [yourObjectInstance zone]];


--
Rob Keniger



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to