main.m :)


The main function in main.m calls the UIApplicationMain function within an autorelease pool:
@autoreleasepool {
   return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
The @autoreleasepool statement supports the Automatic Reference Counting (ARC) system. ARC provides automatic object-lifetime management for your app, ensuring that objects remain in existence for as long as they're needed and no longer.

argc = argument count,->   It signifies how many arguments are being passed into the executable.
argv = argument vector ->  It is a pointer to an array of characters. Or to think about it in another way, it is an array of C strings (since C strings are just arrays of characters).
Link of document (http://stackoverflow.com/questions/4575801/objective-c-main-routine-what-is-int-argc-const-char-argv)


UIApplicationMain
  1. The call to UIApplicationMain creates an instance of the UIApplication class and an instance of the app delegate
  2. The call to UIApplicationMain also scans the app’s Info.plist file. 
The Info.plist file is a property list (that is, a structured list of key-value pairs) that contains information about the app such as its name and icon.

AppDelegate

The main job of the app delegate is to provide the window into which your app’s content is drawn. The app delegate can also perform some app configuration tasks before the app is displayed. (Delegation is a design pattern in which one object acts on behalf of, or in coordination with, another object.)
window object provides a container for the app’s visible content, helps deliver events to app objects, and helps the app respond to changes in the device’s orientation. The window itself is invisible. 

Apple document http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphone101/Articles/01_CreatingProject.html

Comments

Popular posts from this blog

Launch iPhone simulator without Xcode.

How to Make REST api call in Objective-C.

id vs NSObject