IOS appdelegate. m details

Source: Internet
Author: User
Tags home screen

Today, when I learned how to use storyboard in iOS, the operations are all correct, that is, the white page is always displayed after startup and cannot be redirected. After searching for a long time, I couldn't find a solution. Finally, I asked the boss and found the problem. It turned out to be in the appdelegate. M file, The comment is not commented out:

 

-(bool) Application :( uiapplication *) Application didfinishlaunchingwitexceptions :( nsdictionary * ) launchoptions { ///   self. window = [[uiwindow alloc] initwithframe: [[uiscreen mainscreen] bounds];  ///   override point for customization after application launch.   //   self. window. backgroundcolor = [uicolor whitecolor];  ///   [self. window makekeyandvisible];   return   yes ;}  
Because it has been applied to appdelegate in IOS. M does not know much about this problem, so this time we must thoroughly understand appdelegate. M is an important file, which will greatly help you understand iOS development in xcode ~ About appdelegate, There is a foreign user, which is particularly good: appdelegate. h/m define a class that manages the application overall. the app will create one instance of that class and send that object messages that let the delegate influence the app's behavior at well-defined times. for example,-Application: didfinishlaunchingwitexceptions: Is sent when the app has finished launching and is ready to do something interesting. take a look at   Uiapplicationdelegate reference page   For a list of messages that the app delegate can implement to modify the behavior of the application. see it. If the above explanation is used, we can see that appdelegate. h/m is a very important file, if you have done ASP. NET development, this file is similar. global. net. the ascx file controls global variables. This article prohibits reprinting on any website and severely condemn the worms.
This article was first published in, blog garden. Please search: blog garden-Find yourself and view the original version Article
The first address of this article is IOS appdelegate. M details-www.cnblogs.com/xunziji/archive/2012/09/17/2689184.html. default method in h/m: 1. application didfinishlaunchingwitexceptions :( nsdictionary *) launchoptions tells the delegate when the application has launched and may have additional launch options to handle. in the Application Program The delegate call to be executed after startup. 2. applicationwillresignactive :( uiapplication *) application tells the delegate that the application is about to become inactive. this method is called to let your application know that it is about to move from the active to inactive state. after calling this method, the application also posts a uiapplicationwillresignactivenotification notification to give interested objects a chance to respond to T He transition. The delegated call to be executed when the application is about to switch from the active state to the inactive state, such as pressing the Home button, returning to the home screen, or switching between full screen applications. This article prohibits reprinting on any website and severely condemn the worms.
This article was first published in, blog garden. Please search: blog garden-Find yourself and view the original article
The first address of this article is IOS appdelegate. M details-www.cnblogs.com/xunziji/archive/2012/09/17/2689184.html 3. applicationdidenterbackground :( uiapplication *) application tells the delegate that the application is now in the background. use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it I S terminated later. If your application supports background execution, this method is called instead of applicationwillterminate: when the user quits. Delegate call to be executed when the application has entered the background program. 4. applicationwillenterforeground :( uiapplication *) application tells the delegate that the application is about to enter the foreground. called as part of the transition from the background to the inactive state; here you can undo changes of the changes made on entering the background. when the application is going to enter the foreground (activated), the delegate call to be executed exactly corresponds to the applicationwillresignactive method. 5. applicationdidbecomeactive :( uiapplication *) application tells the delegate that the application has become active. restart any tasks that were paused (or not yet started) while the application was inactive. if the application was previusly in the background, optionally refresh the user interface. after the application has been activated, the delegate call to be executed is exactly the same   The applicationdidenterbackground method corresponds. 6. applicationwillterminate :( uiapplication *) application tells the delegate when the application is about to terminate. called when the application is about to terminate. save data if appropriate. this article prohibits reprinting on any website and severely condemn the worms.
This article was first published in, blog garden. Please search: blog garden-Find yourself and view the original article
The first address of this article: IOS appdelegate. m details-Workshop. Have you found that the appdelegate. M/h file in IOS is very important because it manages the entire life cycle of the application ~ This article prohibits reprinting on any website and severely condemn the worms.
This article was first published in, blog garden. Please search: blog garden-Find yourself and view the original article
The first address of this article: IOS appdelegate. M-www.cnblogs.com/xunziji/archive/2012/09/17/2689184.html
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.