"UIKit" Appdelegate:Called after the application has finished launching (only once, only when the program is opened for the first time)Method called after the view load is complete and the application is loaded into memory-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions{ Create a UIWindow cgrect rect = [[UIScreen mainscreen] bounds]; Self.window = [[UIWindow alloc] initwithframe:
iOS program startup process
Full START process
Uiapplicationmain method
UIApplication
Appdelegate Proxy life cycle callbacks
UIWindow
Uiviewcontroller Controller
Load of Controller view
Common Files for iOS engineering
Xxx-infoplist file
Infopliststrings
Xxx-prefixpch
Defaultpng
Iconpng
iOS program startup proc
Master? The role of Info.plist and PCH files? Common use of UIApplication? Proxy methods for Appdelegate? The relationship between UIApplication, Appdelegate, UIWindow and Uiviewcontroller? The full boot process for iOS programsCommon Files in projectsInfo.plist Common Settingsafter building a project, you will see a " project name -info.plist" file under the supportingfiles folder, which is very important
(cfbundleversion)-The version number of the application, each time a new version is posted to the App Store, you need to add this version number Main storyboard file base name (Nsmainstoryboardfile)-The name of the main storyboard file Bundle identifier (Cfbundleidentifier)-The unique identification of the project, to deploy to the real machine using the 2.Pch files • The project's supporting files folder has a "project name-prefix.pch" file, and also a header file pch the contents of the heade
= UIUserNotificationActivationModeForeground;则这个属性被忽略;rejectAction.destructive = YES;2. Create a Category collection of actions (buttons)UIMutableUserNotificationCategory *categorys = [[UIMutableUserNotificationCategory alloc] init];categorys.identifier = @"alert";NSArray *actions = @[acceptAction, rejectAction];[categorys setActions:actions forContext:UIUserNotificationActionContextMinimal];3. Create a uiusernotificationsettings and set the display type of the messageUIUserNotificationSettings
One, hang upWhen there is a phone coming in or lock screen, then your application will hang, at this time, Uiapplicationdelegate delegate will be notified, call the Applicationwillresignactive method, you can override this method, do the work before the hang, For example, close the network and save the data.C code1.-(void) Applicationwillresignactive: (uiapplication*) application{2.3.}When your program is suspended, he will not run in the background.I
Uiapplicationdelegate is one of the most common protocolsThis protocol declares a delegate method that inherits from the UIApplication object in singleton mode. These methods provide an opportunity to respond when an application executes or when significant changes occur. For example (when the application executes, when the boot is complete, the memory is low ...). )One of the main tasks of the Application object delegation method is to track the appl
each uiapplication represents a should be shipped program, and UIApplication is a singleton class;Once the iOS program is started, the first object created is the UIApplication object;//get UIApplication . Object *******************uiapplication*appliction = [uiapplicationsh
function:int Uiapplicationmain ( int argc, char *argv[], nsstring *principalclassname, NSString * Delegateclassname);The previous two parameters have already been analyzed, with the emphasis being on the last two parameters Principalclassname and delegateclassname: Principalclassname is the name of the application class that must inherit from the UIApplication class, and the UIApplication class is
To do ipone development it is necessary to know the life cycle of the iphone program, that is, to click on the application icon to start the program to the exit program, in the process of running the code in the end what happened, only the understanding of the life cycle, it is conducive to our developers to develop better applications.When the user clicks on a picture, the program starts running, starting with the main function:int main (int argc, char *argv[]) {@autoreleasepool {Return Uiappli
a series of data, and here I would paste a part:
CONNECTED (00000003)
Depth=1/c=us/o=entrust, Inc./ou=www.entrust.net/rpa is incorporated by reference/ou= (C) 2009 Entrust, Inc./cn=entrust certification authority-l1c verify error:num=20:unable to get local
issuer certificate
verify return:0
---
certificate chain
... (omitted) ...
(omitted) ...
(omitted)
Start time:1416389389
Timeout : (sec)
Verify return code:0 (OK)
---
The test is here ...
Part seventh
1. Set
1.application Boot Path1Supporting Files--->main.m2 intMainintargcChar*argv[])3 {4 @autoreleasepool {5 /*6 argc: Number of parameters passed in by the system or user7 argv: Actual parameters passed in by the system or user8 9 */Ten //return Uiapplicationmain (argc, argv, Nil, Nsstringfromclass ([Njappdelegate class])); One A //return Uiapplicationmain (argc, argv, @ "UIApplication", Nsstringfromclass
the system memory is low, the system will remove the suspended program, to provide more memory for the foreground program.2. The callback of the agent when each program is running state① tells the agent that the process started but has not yet entered a state to save
-(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (nsdictionary *) launchOptions
{
NSLog (@"① tells the agent process to start but has n
, to provide more memory for the foreground program.2. The callback of the agent when each program is running state① tells the agent that the process started but has not yet entered a state to save
-(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (nsdictionary *) launchOptions
{
NSLog (@"① tells the agent process to start but has not yet entered the state save");
return YES;
}
② tells the
1 PrefaceIOS4 provides background processing to run applications in the background. In some cases, you can even run applications in the background after you press the Home button.
2. DetailsIn IOS, you can click the Home button to pause the application. This pause state is similar in concept to setting Mac to sleep mode. All the application's working memory is in RAM, and it is not executed at all when it is paused. Therefore, switching back to such an application is very fast. The system provid
more memory for the foreground program.2: Agent callback for individual program running state① tells the agent that the process started but has not yet entered a state to save1 -(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (Nsdictionary *) Launchoptions2{3 NSLog (@ "① tells the agent process to start but has not yet entered state save " ); 4 return YES; 5 }② tells the agent to start the basic Completion pr
program, to provide more memory for the foreground program.2. The callback of the agent when each program is running state① tells the agent that the process started but has not yet entered a state to save
-(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (nsdictionary *) launchOptions
{
NSLog (@"① tells the agent process to start but has not yet entered the state save");
return YES;
}
② t
※ Choice question (Total 25 questions, 3 points per question)
1, when the program from the background will be back to the foreground, you will first do the following method:Answer: (B)
A,-(void) applicationdidfinishlaunching: (uiapplication*) application{}
B,-(void) Applicationwillenterforeground: (UIApplication *) application{}
C,-(void) Applicationdidbecomeactive: (
application app launches are divided into two categories: 1. Storyboard 2. No storyboard Storyboard:In the case of a storyboard1. Execute the main function;2. Execute the Uiapplicationmain function* Create UIApplication objects;* Create a uiapplication delegate object;(Note: The third parameter of the Uiapplicationmain function is the name of the uiapplication, a
say it;-(BOOL) Application: (uiapplication *) application didfinishlaunchingwithoptions: ( Nsdictionary *) launchoptionsprogram startup and initialization is called by the-(void) applicationwillresignactive: (uiapplication *) applicationCalled when the program moves from the active state to an inactive state-(void) Applicationdidenterbackground: (uiapplication
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.