• 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: LoadNib not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LoadNib not working


  • Subject: Re: LoadNib not working
  • From: Eric Peyton <email@hidden>
  • Date: Tue, 5 Jun 2001 08:14:24 -0500

Try something like this ...

if (![[NSBundle bundleForClass:[self class]] loadNibNamed:@"CountDown" owner:self]) {

The reason yours is failing is because the NSBundle object is the default NSBundle (i.e. main bundle most likely but I'm not certain) and not the bundle for your dockling class. Since it's not the dockling's bundle object it has no idea where to load the nib from.

Telling it to explicitly use the dockling class's bundle will allow it to find the nib.

Eric

On Tuesday, June 5, 2001, at 02:01 AM, Cyril Godefroy wrote:

Hi,

I have something rather strange happening: a nib which apparently loads but won't appear.
Here's the code:

- (void)showCountDown:(NSBundle*)bundle
{
if (![[bundle class] loadNibNamed:@"CountDown" owner:self]) {
NSLog(@"Failed to load CountDown.nib");
NSBeep();
return;
}
}

I find this rather strange, and have very little code to compare with. First of all, this occurs in a dockling, so it might be a little specific. Also, I went around the tutorials and documentation and have not yet found a good explanation of nibs, how they load, what IBAction and IBOutlet are, and how multiple controllers talk to each other regarding their loading their nibs.

Some help welcome. Thanks

Cyril Godefroy
homepage.mac.com/cgodefroy
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: LoadNib not working
      • From: Cyril Godefroy <email@hidden>
References: 
 >LoadNib not working (From: Cyril Godefroy <email@hidden>)

  • Prev by Date: Re: Newbie question regarding Learning Cocoa
  • Next by Date: Re: C++ framework <-> Cocoa
  • Previous by thread: Re: LoadNib not working
  • Next by thread: Re: LoadNib not working
  • Index(es):
    • Date
    • Thread