1. Introduction
1>The whole application symbolizes that an application is a UIApplication object and uses the singleton design mode.
2>Access this singleton object through [UIApplication sharedApplication]
2. Common usage
1>Set the red number in the upper-right corner of the icon
App. applicationIconBadgeNumber = 10;
2>Set the style of the status bar
App. statusBarStyle = UIStatusBarStyleBlackOpaque;
3>Control display and hide of Status Bar
App. statusBarHidden = YES;
4>Show the circle above the status bar
App. networkActivityIndicatorVisible = YES;
5>Open external resources
-
Open webpage
[App openURL: [NSURL URLWithString: @ "http://www.baidu.com"];
-
Call
[App openURL: [NSURL URLWithString: @ "tel: // 10086"];
-
Text message
[App openURL: [NSURL URLWithString: @ "sms: // 10086"];
6> proxy properties when some system-level events occur in the application, the agent will be notified and handed over to the agent for processing)
@ Property (nonatomic, assign) id delegate;
Proxy method of UIApplicationDelegate
Once the pragma mark program is loaded and started)
- (BOOL) application :( UIApplication) application didfinishlaunchingwitexceptions :( NSDictionary) launchOptions
Call when The pragma mark application loses focus (if an app loses focus, it cannot interact with users)
- (Void) applicationWillResignActive :( UIApplication *) application
The pragma mark program is called when it enters the background.
- (Void) applicationDidEnterBackground :( UIApplication *) application
Called when The pragma mark program is about to enter the foreground
- (Void) applicationWillEnterForeground :( UIApplication *) application
Call when The pragma mark application gets the focus (an app can interact with users only after the focus is obtained)
- (Void) applicationDidBecomeActive :( UIApplication *) application
The pragma mark program may be called when it is about to be closed.
- (Void) applicationWillTerminate :( UIApplication *) application
When The pragma mark program receives a memory warning, it will call
- (Void) applicationDidReceiveMemoryWarning :( UIApplication *) application