UIApplication Little Common Sense

Source: Internet
Author: User

1 //the first time the program was started when the UIApplication object, it is a simple interest object, is a symbol of the program, so can not be uiapplication *app = [[UIApplication alloc] init], the way to create , using the method is uiapplication *app = [UIApplication sharedapplication]; To extract uiapplication objects2 3 //UIApplication is an application-level operation, often used to make one app jump to another application, Common properties: Applicationiconbadgenumber: Displays a number in the upper-right corner of the program icon, usually used as a reminder of the number of messages4 5 6 //Note: To control the status bar with UIApplication, the first thing to do is to add a property to the global configuration: View controller-based status bar appearance, and set to No, This means canceling the controller's permission to change the status bar. 7 8  //additional supplemental controller How to control the status bar9  //cannot flexibly change the status bar, once wrote the method basically is to write the controller state to die, cannot change, does not have the uiapplication that can through the monitoring and so on changeTen  One  A     //eg: Controller control status bar -  - //Hide the status bar the-(BOOL) Prefersstatusbarhidden - { -     returnYES; - } +  - //set the status bar to white +-(uistatusbarstyle) Preferredstatusbarstyle A { at     returnuistatusbarstylelightcontent; - } -      - //eg:uiapplication Control status bar -  -     //single-instance object uiapplication for extraction program inUIApplication *app =[UIApplication sharedapplication];

//In iOS8 to achieve badge, alert and sound, etc. require user consent, because these are counted as notification "notice"

, in order to prevent some applications to send users a "notice" to harass users, so in IOS8, to "notify" the user must agree to the line.

 -     //Set program icon The top right corner number is toApp.applicationiconbadgenumber = -; +     //to set the status bar to a hidden state -App.statusbarhidden =YES the     //Set the status bar style to white *App.statusbarstyle =uistatusbarstylelightcontent; $     //Hide the status bar in animationPanax Notoginseng [app Setstatusbarhidden:yes Withanimation:uistatusbaranimationfade]; -     //Animate the status bar to a white style the[App Setstatusbarstyle:uistatusbarstylelightcontent Animated:yes];
1 //      0 means clear the top right of the icon in the number 2     0 ; 3     4 //      Set the display network status, meaning that the status bar will show a small chrysanthemum in the rotation, meaning that the operation of the program to network, the need to consume 5     of traffic app.networkactivityindicatorvisible = YES;
//URL: A unique path to a resource//    //the composition of the URL = = Protocol header://host domain name/path//    //composition of network resource URL = =Http://www.baidu.com/1.png//    //the composition of the local file resource url = = File:///users/apple/desktop/1.png//uiapplication automatically identifies the URL and automatically calls the phone's other apps to open the appropriate URL[App Openurl:[nsurl urlwithstring:@"http://ios.itcast.cn"]]; //Call[App Openurl:[nsurl urlwithstring:@"tel://10086"]];

UIApplication Little Common Sense

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.