Re: How to load a nib from a path
Re: How to load a nib from a path
- Subject: Re: How to load a nib from a path
- From: Sailor Quasar <email@hidden>
- Date: Fri, 20 Feb 2004 13:24:56 -0500
On Feb 20, 2004, at 1:17 PM, Bill Houston wrote:
if([frameworksBundle loadNibNamed:@"MY_UI" owner:self]) {
NSLog(@"failed to load Nib from specified location");
}
With all due respect to programmers everywhere, which header file were
you reading? :)
The instance-specific version is -loadNibFile:externalNameTable:zone:,
not -loadNibNamed:owner:. This would be an implementation of the
version you were trying, which should work identically to
+loadNibNamed:owner: aside from being instance-specific (written in
Mail.app):
@interface NSBundle (NSNibLoading+AppleMissedAMethod)
- (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner;
@end
@implementation NSBundle (NSNibLoading+AppleMissedAMethod)
- (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner
{
return [self loadNibFile:nibName
externalNameTable:[NSDictionary dictionaryWithObject:owner
forKey:@"NSOwner"] zone:[owner zone]];
}
@end
The bundle additions are part of AppKit - have you included that
framework?
Show us some code! What Sailor Quasar suggested should work.
j o a r
On 2004-02-20, at 17.50, Bill Houston wrote:
Thanks, but both "loadNibFile" and "loadNibNamed" are part of
NSBundle
Additions, which don't seem to extend specific bundle instances.
When
you
compile the code you get an "unknowm message selector" error.
-- Sailor Quasar, guardian of Leraz's memory
"A face of stone may hide a soul with the deepest Love of all"
Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.