UIApplication Common Properties and methods summary--ios

Source: Internet
Author: User

uiapplication 1. Introduction       

1> a symbol of the entire application, an application on a UIApplication object, using a singleton design pattern

2> access to this singleton object via [UIApplication sharedapplication]

2. Common usage          

1> set icon in the upper right corner of the red hint number

App.applicationiconbadgenumber = 10;

2> setting the style of the status bar

App.statusbarstyle = Uistatusbarstyleblackopaque;

3> control the display and hiding of the status bar

App.statusbarhidden = YES;

4> Show the circle above the status bar

app.networkactivityindicatorvisible = YES;

5> Open External Resources

* Open Web Page

[App Openurl:[nsurl urlwithstring:@ "http://www.baidu.com"];

* Call

[App Openurl:[nsurl urlwithstring:@ "tel://10086"];

* Send text messages

[App Openurl:[nsurl urlwithstring:@ "sms://10086"];

6> Agent Properties (when the application has some system-level events, the agent is notified and sent to the agent for processing)

@property (nonatomic,assign) id<uiapplicationdelegate> delegate;

proxy methods for Uiapplicationdelegate

#pragma mark program is loaded (started) and is called once

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions

Called when the #pragma mark application loses focus (an app cannot interact with the user if it loses focus)

-(void) Applicationwillresignactive: (uiapplication *) application

#pragma mark program enters the background and calls

-(void) Applicationdidenterbackground: (uiapplication *) application

#pragma mark program is about to enter the foreground, call

-(void) Applicationwillenterforeground: (uiapplication *) application

Called when the mark application gets focus #pragma (an app can interact with the user only after the focus has been focused)

-(void) Applicationdidbecomeactive: (uiapplication *) application

#pragma mark program may be called when it is about to be closed

-(void) Applicationwillterminate: (uiapplication *) application

#pragma mark program receives a memory warning called

-(void) applicationdidreceivememorywarning: (uiapplication *) application

&NBSP;

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.