Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Nib Files and Cocoa

Nib files are integrated into many of the standard workflows in Cocoa. For example, when the user opens a new document, the NSDocument class automatically creates a new document window based on the contents of an associated nib file. This automatic nib file support is very convenient and saves you the trouble of loading commonly used nib files yourself. There may still be times though when you need to display some user interface element that is not part of a common workflow. For example, you might need to display a custom inspector panel or you might want to set or change the contextual menu associated with a custom object. When those situations occur, you can programmatically load the needed nib files and integrate the resulting objects into your application.

Note: Although you can create a Cocoa application without using nib files, doing so is very rare. The process for doing so involves overriding a large amount of automatic Cocoa behavior, and thus would require much more work for the same end result.

Contents:

Anatomy of a Nib File
The Nib Object Life Cycle
Automatic Support For Nib Files
Nib File Design Guidelines
Loading Nib Files into Your Program Programmatically
Connecting Menu Items Across Nib Files




< Previous PageNext Page > Hide TOC


Last updated: 2007-09-04




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice