Application startup Principles in iOSSource: http://m.warting.com/program/201601/127355.htmlFirst, UIApplication1. Brief introduction(1) The UIApplication object is a symbol of the application, and a UIApplication object represents an application.(2) Each application has its own UIApplication object, and is a singleton, if you try to create a new
After the application is created, the AppDelegate.h file and the APPDELEGATE.M file are default.What is Appdelegate? Appdelegate is a proxy for the entire application, providing a similar monitoring interface for program startup, exit, and so on.APPDELEGATE.Mthe file where the interface is located, common interfaces are:Application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions//the delegate call to execute after the application is startedApplicationwillresignactive: (
Master • 1. common files in the project (info. plist And PCH files) • 2. uiapplication • 3. proxy method of appdelegate • 4. complete IOS program Startup Process (relationships between uiapplication, appdelegate, uiwindow, and uiviewcontroller)
• 1. Common files in the project (Functions of info. plist And PCH files)
Info. plist
1> info. common plist settings • after a project is created, a "project name-
The iphone application is initiated by the main function main, which is responsible for invoking the Uiapplicationmain function, as shown in the following form: int uiapplicationmain (int argc, char *argv[], NSString *Principalclassname, NSString *delegateclassname); So what exactly does the Uiapplicationmain function do? This function is mainly responsible for three things:1) Initializes the application object from the given class name, which is an instance of initializing the
In a program, you can call an application that comes with the system. For example, when I enter the program, I want to directly call Safar to open a webpage. Below is a simple usage:
-(Bool) Application :( uiapplication *) Application didfinishlaunchingwitexceptions :( nsdictionary *) launchoptions {self. window = [[[uiwindow alloc] initwithframe: [uiscreen mainscreen] bounds] autorelease]; self. viewcontroller = [[[viewcontroller alloc] initwithnibna
In a program, you can call an application that comes with the system. For example, when I enter the program, I want to directly call safar to open a webpage. Below is a simple usage:
-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions{Self. window = [[[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds] autorelease];Self. viewController = [[ViewController alloc] initWithNibName
to allow notification; Once the registration method is called, whether or not the user chooses to allow notification to invoke the application at this moment-(void) Application: (uiapplication *) application didregisterusernotificationsettings: (Uiusernotificationsettings *) The Notificationsettings proxy method, in this method, is based on the user's choice: If the notification is allowed, the notification is created and executed after a certain amo
Master• 1. Common documents in the project (the role of Info.plist and PCH files)2.uiapplicationproxy methods for 3.appdelegatethe complete start-up process of the 4.ios program (uiapplication, Appdelegate, UIWindow, uiviewcontroller relationships)
• 1. Common documents in the project (the role of Info.plist and PCH files)
Info.plist
1>info.plist Common Settings• After building a project, you will see a "project name-info.plist"
objects are symbols of the applicationEach application has its own UIApplication object, and it is a singletonThis singleton object can be obtained by [UIApplication Sharedapplication]The first object created after an iOS program is started is a UIApplication objectUse the UIApplication object to perform some applicat
Program Start Principle Mastery
The role of Info.plist and PCH files
Common use of UIApplication
Proxy methods for Appdelegate
The relationship between UIApplication, Appdelegate, UIWindow and Uiviewcontroller
Full boot process for iOS programs
Info.plist Common Settings
After building a project, you will see a "project name-info.plist" file under the supporting Files
icon.pngBundle version (cfbundleversion)-The version number of the application, which needs to be increased each time a new version is posted to the App Storemain Storyboard file base name (nsmainstoryboardfile)-the name of the primary storyboardBundle identifier (cfbundleidentifier)-Unique identification of the project, deployed to the real machine2.PCH file* The project's supporting files folder has a "project name-prefix.pch" file, which is also a header file* The contents of the PCH header
execution flow for example, a block represents a collection of code or other resources that a thread needs to obtain, and the arrow direction represents the direction in which the thread is transferred.is the declaration period of the main thread. Let's look at the main function:#import #import"QSAppDelegate.h"int Main (intChar * argv[]) { @autoreleasepool { returnclass ])); }}This is the entry for the thread, after which the function uiapplicationmain is executed.Uiapplicationmain
Program Start-Life cycleFrom: qq:8537400911. first explain the UIApplication object(1) The UIApplication object is a symbol of the application, and a UIApplication object represents an application.(2) Each application has its own UIApplication object, and is a singleton, if you try to create a new
iOS program start-up process
The complete procedure for starting a program is outlined below:1.main function2.UIApplicationMain* Create UIApplication objects* Create a UIApplication delegate object3.delegate object starts processing (listening) system events (no storyboard)* When the program is started, the agent's application:didfinishlaunchingwithoptions is called: method* Create UIWindow in applicati
// ... Represents a variable parameter inside a macro//__va_args__ represents a variable parameter inside a function#ifdefDEBUG//represents the current debugging phase#defineXmglog (...) NSLog (__va_args__)#else //Release Phase#defineXmglog (...)#endif#endifSecond, uiapplication
1. What is UIApplicationUIApplication objects are symbols of the applicationEach application has its own UIApplication objec
@ Protocol UIApplicationDelegate @ Optional-(Void) applicationDidFinishLaunching :( UIApplication *) application; // called after the program is loaded-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions _ OSX_AVAILABLE_STARTING (_ MAC_NA ,__ IPHONE_3_0 );// This method is called when the program is loaded and there may be additional startup op
DetailsIPhoneHowGet objectThe tutorial is the content to be introduced in this article, mainly aboutIPhoneHowGet objectHandle and its parent object handle. Let's take a look at it in detail.IphoneFirst, let's look at the details.
GeneralIPhoneThe program object structure is as follows:
Number of objects object type
1 UIApplication
1 UIApplicationDelegate/subclass
1, N UIViewController/subclass
1, N UIView/subclsss
Although some books
12-program startup principle, 12-startup PrincipleProgram startup principles
Functions of Info. plist And pch files
Common Use of UIApplication
Proxy method of AppDelegate
Relationships between UIApplication, AppDelegate, UIWindow, and UIViewController
Complete iOS program Startup Process
Common settings of Info. plist
After a project is created, a file named "project name-Info. plist" is displayed
class at load time, using this technique to add another Dylib class method without changing the dylib, rather than the usual way to change a class by defining a category.The dependencies of the master execution file and the associated dylib form a huge graph of the graphs, the execution initializer loads the leaf nodes first, and then progressively loads the intermediate nodes up until the root node is loaded at last. This loading order ensures security, and the rest of the dylib files that it
Appdelegate's Related introductioniOS notes@interface Appdelegate:uiresponder @property (Strong, nonatomic) UIWindow *window;Appdelegate events that can be handled include:1> life-Cycle events for applications (such as program startup and shutdown);2> system events (such as incoming calls);3> Memory Warning ...Appdelegate is a proxy for the entire application, providing a similar monitoring interface for program startup, exit, etc.The header file introduced by Appdelegate is #import Inherit from
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.