IOS Dev (39) Do you understand UIApplicationDelegate?
-
application:didFinishLaunchingWithOptions:applicationWillResignActive:applicationDidBecomeActive:applicationWillEnterBackground:applicationWillEnterForeground:applicationDidReceiveMemoryWarning:
Application: didfinishlaunchingwitexceptionsThis is the first protocol method triggered after the UIApplication is instantiated. The main task of this product is to create a UIWindow where the Controller view is displayed.
ApplicationWillResignActive:This Protocol method is triggered when the application changes from Active to Inactive. For example, when a call is made.
ApplicationDidBecomeActiveThis Protocol method is triggered when the application changes from Inactive to Active.
ApplicationWillEnterBackground:This Protocol method is triggered when the application switches to the background.
ApplicationWillEnterForeground:This Protocol method is triggered when the application switches to the foreground.
ApplicationDidReceiveMemoryWarning:This Protocol is triggered when the device memory is insufficient. Here I have a question: is it triggered when Background is used?
If the system still does not have enough memory after the application executes this method, the system may kill the application.
What if I want to actively obtain AppDelegate?[[UIApplication sharedApplication] delegate]
Haha, that's easy.
Reprinted please indicate the blog from laruence: http://blog.csdn.net/prevention