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