This is objectLoadNib.m in view mode; [Download] [Up]
/*
* objectLoadNib - category on Object for NIB loading
*
* You may freely copy, distribute and reuse the code in this example.
* This code is provided AS IS without warranty of any kind, expressed
* or implied, as to its fitness for any particular use.
*
* Copyright 1995 Ralph Zazula (zazula@next.com). All Rights Reserved.
*
*/
#import "objectLoadNib.h"
#import <appkit/appkit.h>
@implementation Object(LoadNib)
- loadNib:(const char *)name
/*
* Loads the file 'name'.nib from the bundle for the current class.
*/
{
NXBundle *bundle;
char path[MAXPATHLEN+1];
bundle = [NXBundle bundleForClass:[self class]];
if([bundle getPath:path forResource:name ofType:"nib"]) {
[NXApp loadNibFile:path owner:self];
return self;
}
fprintf(stderr, "couldn't load nib %s.\n",name);
return nil;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.