In this section you’ll define controller and model classes for Currency Converter.
You’ll recall from Chapter 6 that you must go to the Classes display of the nib file window to define a class. Let’s start with the ConverterController class:
In Interface Builder, select the Classes display of
Create an NSObject subclass called ConverterController.
ConvertorController needs access to the text fields of the interface, so you must create outlets for them. ConverterController must also communicate with the Converter class (yet to be defined) and thus requires a fourth outlet for that purpose.
Select ConverterController in the Classes window.
Click the electrical outlet icon to the right of the class.
Choose Add Outlet from the Classes menu.
Name this outlet
rateField outlet is still
selected, all you have to do to create more outlets is press
Return. Do this once to create the
outlet, and again for the
Add an outlet named
ConverterController has one action method,
convert:. When the user clicks the Convert
convert: message is sent to the target object, an instance of ConverterController. Action refers both to a message sent to an object when the user clicks a button or manipulates some other ...