Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.


Inherits From: Object
Conforms To: IBInspectors
Declared In: apps/InterfaceBuilder.h

Class Description

The IBInspector class defines the interface between an inspector for a loadable module and the Interface Builder application. When you build a new inspector for Interface Builder, you create a subclass of IBInspector.

The inspector you define must load its interface (that is, the nib file containing the interface), and it must override the inherited ok:, revert:, and wantsButtons methods.  The nib file is generally loaded as part of the inspector's init method.  The wantsButtons method controls whether the inspector displays OK and Revert button.  (As with Interface Builder's standard inspectors, most custom inspectors won't need these buttons--instead, the user's actions in the Inspector panel are registered immediately by the inspected object.)  The ok: and revert: methods control the synchronization of the Inspector panel's state with that of the inspected object.  Interface Builder sends the inspector a revert: message to make the inspector reflect the current state of the inspected object.  The ok: message should cause the inspector to set the state of the inspected object to that displayed in the Inspector panel.

An inspector should send itself a touch: message when the user begins modifying the data it displays.  This message displays a broken "X" in the panel's close box and enables the inspector's OK and Revert buttons, if present.  (See textDidChange: for alternate way to achieve this result.)

Instance Variables

id object;

id window;

id okButton;

id revertButton;

object The object that's being inspected.
window The Panel that contains the inspector's user interface
okButton The Inspector panel's OK button, if present.
revertButton The Inspector panel's Revert button, if present.

Adopted Protocols

IBInspectors ok:

Method Types

Accessing objects object
Managing changes touch:

Instance Methods


Returns the object that's being inspected in Interface Builder.


Sends the IBInspector a touch: message on behalf of some Text object in the Inspector panel.

By making your inspector object the delegate of any Text object in the Inspector panel, the panel will be updated appropriately as the user alters the panel's contents.

See also:  touch:


Changes the image in the Inspector panel's close box to a broken "X" to indicate that the contents have been edited.  Also, enables the buttons that allow the user to commit or abandon changes.

See also:  textDidChange:


Returns the Window object that contains the user interface for the inspector.