Instance Method

instantiateWithOwner:topLevelObjects:

Instantiates objects in the nib file with the specified owner.

Declaration

- (BOOL)instantiateWithOwner:(id)owner topLevelObjects:(NSArray * _Nullable *)topLevelObjects;

Parameters

owner

The object to set as the Nib’s owner (File’s Owner).

topLevelObjects

On return, an array containing the top-level objects of the nib.

Return Value

YES if the nib is instantiated; otherwise NO.

Discussion

Unlike legacy methods, the objects adhere to standard Cocoa memory management rules; it is necessary to keep a strong reference to the objects or the array to prevent the nib contents from being deallocated.

Outlets to top level objects should be strong references to demonstrate ownership and prevent deallocation.

See Also

Instantiating a Nib

- instantiateNibWithOwner:topLevelObjects:

Unarchives and instantiates the in-memory contents of the receiver's nib file, creating a distinct object tree and set of top level objects.

Deprecated
- instantiateNibWithExternalNameTable:

Unarchives and instantiates the in-memory contents of the receiver's nib file, creating a distinct object tree and top level objects.

Deprecated