*How Tos* in iPhone App Development (baby steps) – updated

I’m just starting to learn how to write objective-c for iPhone application. Objective-c is very new to me, but I’ve known java and c# pretty well. So most of posts that I’m going to upload on iPhone app will be notes to myself, so I won’t forget and use it as references later.

#1 reference – how to instantiate an object!
In objective-c, “alloc” is used instead of “new”. Here’s a simple text on how to create an object. (assuming we are not using singleton’ized class)

1
2
UIColor mycolor = [[UIColor alloc]
                          initWithRed:0.32f green:0.37f blue:0.84f alpha:1.0f];

I was so confused with the objective-c grammar when I first started learning objective-c. As I looked at the grammar more and more, it became much more clear now luckily.

Updated: Nov 23, 2008

Programming flow for the iPhone application is like this:

  1. calls main method
  2. in main, calls “UIApplicationMain” with applicationDelegate class as a parameter along with other parameters
  3. applicationDelegate creates UIWindow and root level UIViewController

Those three steps are pretty much mandated in order to launch something in your iPhone app for the sake of MVC design pattern.

Comment are closed.