Up

# NSNib

### Authors

Gregory John Casamento (`greg_casamento@yahoo.com`)

> This class serves as a container for a nib file. It's possible to load a nib file from a URL or from a bundle. Using this class the nib file can now be "preloaded" and instantiated multiple times when/if needed. Also, since it's possible to initialize this class using a NSURL it's possible to load nib files from remote locations.
> This class uses: NSNibOwner and NSNibTopLevelObjects to allow the caller to specify the owner of the nib during instantiation and receive an array containing the top level objects of the nib file.

Copyright: (C) 2004 Free Software Foundation, Inc.

# Software documentation for the NSNib class

## NSNib : NSObject

> Declared in:
>   AppKit/NSNib.h

> Conforms to:
>   NSCoding

Availability: OpenStep
Description forthcoming.

Instance Variables
Method summary

- -initWithContentsOfURL:
- -initWithNibNamed:bundle:
- -instantiateNibWithExternalNameTable:
- -instantiateNibWithExternalNameTable:withZone:
- -instantiateNibWithOwner:topLevelObjects:

### initWithContentsOfURL:

- (id) initWithContentsOfURL: (NSURL*)nibFileURL;
Availability: OpenStep
Load the NSNib object from the specified URL. This location can be any type of resource capable of being pointed to by the NSURL object. A file in the local file system or a file on an ftp site.

### initWithNibNamed: bundle:

- (id) initWithNibNamed: (NSString*)nibNamed bundle: (NSBundle*)bundle;
Availability: OpenStep
Load the nib indicated by `nibNamed`. If the `bundle` argument is `nil`, then the main bundle is used to resolve the path, otherwise the bundle which is supplied will be used.

### instantiateNibWithExternalNameTable:

- (BOOL) instantiateNibWithExternalNameTable: (NSDictionary*)externalNameTable;
Availability: OpenStep
This method instantiates the nib file. The externalNameTable dictionary accepts the NSNibOwner and NSNibTopLevelObjects entries described earlier. It is recommended, for subclasses whose purpose is to change the behaviour of nib loading, to override this method.

### instantiateNibWithExternalNameTable: withZone:

- (BOOL) instantiateNibWithExternalNameTable: (NSDictionary*)externalNameTable withZone: (NSZone*)zone;
Availability: Not in OpenStep/MacOS-X
This is a GNUstep specific method. This method is used when the caller wants the objects instantiated in the nib to be stored in the given `zone`.

### instantiateNibWithOwner: topLevelObjects:

- (BOOL) instantiateNibWithOwner: (id)owner topLevelObjects: (NSArray**)topLevelObjects;
Availability: OpenStep
This method instantiates the nib file. It utilizes the instantiateNibWithExternalNameTable: method to, in a convenient way, allow the user to specify both keys accepted by the nib loading process.

## Instance Variables for NSNib Class

### _loader

@protected id _loader;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _nibData

@protected NSData* _nibData;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _url

@protected NSURL* _url;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

Up