2、@autoreleasepool { 4. return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 5. } 6.} main函数的两个参数,iOS中没有用到,包括这两个参数是为了与标准ANSIC保持一致。 UIApplicationMain函数,前两个和main函数一样,重点是后两个,官方说明是这样的:[cpp] viewplaincopyprint?1.// If nil is spec
3、ified for principalClassName, the value for NSPrincipalClass from the Info.plist is used. If there is no 2.// NSPrincipalClass key specified, the UIApplication class is used. The delegate class will be instantiated using init. 3.UIKIT_EXTERN int UIApplicationMain(int argc
6、reen mainScreen] bounds]] autorelease]; 4. // Override point for customization after application launch. 5. self.window.backgroundColor = [UIColor whiteColor]; 6. [self.window makeKeyAndVisible]; 7. NSLog(@"iOS_didFinishLaunchingWithOptions"); 8. return
7、YES; 9.} 10. 11.- (void)applicationWillResignActive:(UIApplication *)application 12.{ 13. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS
8、message) or when the user quits the application and it begins the transition to th