Stepping through the App Life Cycle
Although simple for the eventual user, the birth, life, and death of an application is a pretty complex process. In this section, I explain what happens throughout the time that the user launches the app from the Home screen, uses the app, and then stops using the app, either because she is done or decides to respond to an interruption such as an SMS message.
The life of an iPad app begins when a user launches it by tapping its icon on the Home screen. The system launches your app by calling its
main function — which Xcode kindly lets you peek at if you go to the Project navigator, open the disclosure triangle next to the Supporting Files group, and select
int main(int argc, char *argv)
return UIApplicationMain(argc, argv, nil, NSStringFromClass([RTAppDelegate class]));
main function is where a program starts execution. This function is responsible for the high-level organization of the program’s functionality and typically has access to the arguments given to the program when it gets executed.
main function does only these two things:
1. Sets up an autorelease pool:
This is a piece of memory-management ...