logo

Books : Beginning iPhone Development (Exploring the iPhone SDK ( Apple )

Beginning iPhone Development 1. Objective C has Outlets and Actions.

2. The model holds the classes for your application, the View makes up the controls and elements of the interfaces, and the controller binds the model with the view. The goal of the MVC is to design and program for maximum reusability of code.

3. An outlet is a pointer to objects within the interface. For example, an outlet could point to a label control. The outlet in code could be used to change the text on the label. Action methods are wired to send information back to the controller. Actions are methods of the controller class. The controller method is trigger by a interface control. Action methods do not return values. By putting the IBOutlet in the header file, it tells the interface builder that the instance variable will connect with the object in the nib.

4. One action method can handle messages from multiple controls. There are four different states of a control: normal, highlighted, disabled, and selected.

5. If you instantiate an object than your responsible to release its memory. Otherwise, prebuilt functions autoreleases the memory.

6. Delegates are classes that are responsible for doing certain things on behalf of another object. Every iPhone application has one and only one UIApplication which is responsible for the applications run loop and handles application level functionality. UIApplication is part of the UIKit. Hold you mouse over the keyword and press the option key and double click, a popup box will appear telling you about the delegate class.

7. The (NIB), The MainWindow.lib causes your application's delegate, main window, and view controller to get created at runtime.

8. When the UIViewController instantiates it looks for the corresponding nib file to load into memory. The nib file contains the interface elements.

9. Hold down the control key, click the file owners icon and drag it too the label control. You have connected the File owners outlet to the label object in the nib. Command 2 launches the connection inspector. The interface builder nib file is separate from the Xcode viewcontroller code.

s