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: Bill Houston <email@hidden>
- Date: Fri, 20 Feb 2004 10:17:58 -0800
Here is the code :
// init the application
NSApplicationLoad();
// check to see if we got a path from our host application
if(frameworksPath == NULL) {
if (![NSBundle loadNibNamed:@"MY_UI" owner:self]) {
NSLog(@"failed to load MY_UI nib");
}
} else {
// try to use the path we were given
NSString *frameworksPathString = [NSString
stringWithCString:frameworksPath];
NSBundle *frameworksBundle = [NSBundle
bundleWithPath:frameworksPathString];
if([frameworksBundle loadNibNamed:@"MY_UI" owner:self]) {
NSLog(@"failed to load Nib from specified location");
}
}
sharedController = self;
return self;
}
Here is the warning I get when I compile the code:
Warning : receiver cannot handle this message
Controller.m line 31 if([frameworksBundle loadNibNamed:@"MY_UI"
owner:self]) {
On 2/20/04 9:20 AM, "j o a r" <email@hidden> wrote:
>
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.
_______________________________________________
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.