Interface Builder not only lets you construct the user interface of an application from real objects stored on palettes, but lets you partially define a class in terms of its name, its superclass, its outlets, and its actions.
You define a custom class using the Classes menu and the Classes display of the nib file window.
"MyObject" appears in an editable field below java.lang.Object.
An outlet is a reference one object holds to another object so that it can easily send that object messages; it is an instance variable of type
id
or
IBOutlet
. The TempController class has two outlets, one to each of the text fields in the user interface.
Tthe area under TempController expands to include "Outlets" and "Actions."
You can press the Return key instead of choosing the menu command.
Repeat steps 2 through 4, this time naming the outlet "fahrenheit".
To collapse the TempController item, click any other class. in the Classes display.
An action refers to a method invoked in a target object when a user event occurs, such a the click of a button or the movement of a slider. We want a method in TempController to be invoked whenever the user presses the Return key in a text field.
The area under TempController expands to include "Outlets" and "Actions."
You can press the Return key instead of choosing the menu command.
See the illustration above for an example of what things look like when you complete this task.