About UIApplication's knowledge

Source: Internet
Author: User

Use of UIApplication objects

1. There is also an object in Android that is symbolic of this program is a single case

2. Access method [UIApplication shareapplication]

3. The first object at the start of an iOS program is a UIApplication object

4. Use application to perform one-shoe application-level operation

5 The use of application can be used for a shoe application level operation of the example??????

[UIApplication Shareapplication]

#define Kdeviceversion [[Uidevice Currentdevice] Systemversion].floatvalue

@interface Appdelegate ()

@end

@implementation Appdelegate

-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {

Override point for customization after application launch.

if (kdeviceversion >= 8.0) {

Use local notifications (in this case only badge, but also alert and sound are the notification type, in fact, if only the non-reading in the AppIcon display, only need to badge, it is all written in order to facilitate later use)

Uiusernotificationsettings *settings = [Uiusernotificationsettings Settingsfortypes:uiusernotificationtypebadge | Uiusernotificationtypesound | Uiusernotificationtypealert Categories:nil];

To register

[Application registerusernotificationsettings:settings];

}

return YES;

}

-(void) OnClick {

Do some reference-level operations

UIApplication *app = [UIApplication sharedapplication];

App.applicationiconbadgenumber = 1000;

}

About UIApplication's knowledge

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.