• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to load a nib from a path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: How to load a nib from a path
      • From: j o a r <email@hidden>
    • Re: How to load a nib from a path
      • From: Sailor Quasar <email@hidden>
References: 
 >Re: How to load a nib from a path (From: j o a r <email@hidden>)

  • Prev by Date: NSTextStorage attribute runs
  • Next by Date: Re: Drag and Drop: Cocoa window in Carbon app...
  • Previous by thread: Re: How to load a nib from a path
  • Next by thread: Re: How to load a nib from a path
  • Index(es):
    • Date
    • Thread