• 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: 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.

References: 
 >Re: How to load a nib from a path (From: Bill Houston <email@hidden>)

  • Prev by Date: Re: Drag and Drop: Cocoa window in Carbon app...
  • Next by Date: Re: How to load a nib from a path
  • 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