I am confused of how an iphone app goes when it start running. I mean when I am trying to write a app, I get confused and lost of terms like "viewDidLoad", "viewDidUnload", "dealloc", "applicationDidLoad" etc. I have no idea when one comes first, which one comes later when an app runs. For instance, say, I would like to add a view(or picture) showing my app logo when the app is just opened (just like what most apps would do). So, where (viewDidLoad or applicationDidLoad) should I put my code in?

Well, this is just an example. I will appreciate it if you can tell me the answer. But what I am most concerned is about the life cycle of running a app, i.e at which state, which method will be called. Thanks in advance!

2 Answers
2

the first code you get to run after the application has finished launching, is the one you put in the Application Delegate in the method application:didFinishLaunchingWithOptions. The app delegate is the class that is set to receive general notifications about what's going on with the app, like it finished launching :)

The other kind of 'notifications' of changes in the state of the app, or the life cycle of views are:

Those methods are declared in UIViewController, and you can implement them in your UIViewController subclasses to customize the behaviour of a view in those situations (each method name is self explanatory)

Does one have to specifically choose to implement these in one's view controller class? For example, when I create a UIViewController subclass, these methods are not included by default; I only have viewDidLoad and viewDidUnload, but if I desire to "customize the behavior of a view", can I add these methods in?
–
qegalJun 6 '12 at 4:28

That should itself be another question in a separate thread in SO, there's not enough space here to answer :) Post the question and reply this comment with the link and I'll answer you ;)
–
Javier SotoJun 6 '12 at 17:02