Types of Applications in XCode:


Navigation-based Application - Exactly what it sounds like. Imagine the mail application. We select an option and it navigates to another page (or activity, if you come from the world of Android).


OpenGL ES Application - an application which uses OpenGL. This can be pretty heavy stuff.


Tab Bar Application - An application which is similar to a website with frames. There will be a tab pane at the bottom of the app with 4-5 options and choosing an option will change the activity the user is experiencing.


Utility Application - An interesting kind of application which kind of "flips." These apps tend to have a miniature "i" icon on the bottom right corner of the screen. Upon clicking the icon, the application "flips" into another activity.


View-based Application - Probably the most commonly selected project.


Window-based Application - this sort of project tends to be very bare. I suppose this is the "expert" developer mode where he or she has to pick and choose what components are required for the application.




MVC (Model-View-Controller):


It's just a software design pattern. The idea is to keep the models and the views separate from each other. The philosophy is that a developer should be able to make modifications to one without affecting other. The view never talks to the model. However, the model and the view both talk to the controller.


My little memory trick to remember this paradigm is that: (1) model, view and controller are three good friends and (2) controller just happens to be a control freak and liaisons the group's communication. I'm sure I can think of a better mnemonic but this will do for now. Views are easy to make and are essentially created in the interface builder. Models can best be thought of as "your concept" for the application and I am going to generalize the controller as the code.




Basic Interaction:


After starting a view-based application, we get all of that handy objective-C stub code. The xib files (pronounced "nib") open up in interface builder. We can drag and drop elements (such as text boxes, buttons, text views, etc) into the applications view. 


The interactions between the elements we just selected are defined in the @interface section of the viewController.h file. Pretend we have a text box where a user enters text, a text view to show whatever the user submitted in the text box, and a button to process the action. The text box and text fields would be IBOutlet objects (they are outlets for actions) and the button would be an IBAction object (because we use the button to perform an action).


So let's crack open the header file.


@interface someViewController : UIViewController {
  IBOutlet UITextField *message;
  IBOutlet UILabel *label;
}


We also define @property (nonatomic, retain) for the objects we intend to use (under the @interface section).


@property (nonatomic, retain) IBOutlet UITextField *message;
@property (nonatomic, retain) IBOutlet UILabel *label;


The button requires a method declaration (IBAction).


- (IBAction) lightsCameraAction;


Now we go the the implementation (.m file).


@implementation someViewController


@synthesize message;
@synthesize label;


- (IBAction) lightsCameraAction {
  NSString *internalTemporaryStorage = [[NSString alloc] initWithFormat:@"Your text, %@", message.text];
  label.text = internalTemporaryStorage;
  [internalTemporaryStorage release];
}


The last step is to go back to the interface builder and literally connect the objects to each other. We have to click on the "File's Owner" box and connect the label object to the text view. We have to connect the message object to the text field. And finally, we have to connect the performSomeAction method to the button (and be sure to set the button action to be "touch up inside").