because you want to set up applicationiconbadgenumber in IOS8, you need the user's authorization, in IOS8, you need to add the following code:
Uiusernotificationsettings *settings = [Uiusernotificationsettings Settingsfortypes:uiusernotificationtypebadge Categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];
However, if the two sentences are running in the IOS7 system, then the error will be, so you need to first determine the iOS version, the complete code is as follows:
float Version = [[[Uidevice Currentdevice] systemversion] floatvalue]; if (version >= 8.0) { uiusernotificationsettings *settings = [uiusernotificationsettings settingsfortypes: Uiusernotificationtypebadge Categories:nil]; [[UIApplication sharedapplication] registerusernotificationsettings:settings];}
IOS Development-ios 8 Setup Applicationiconbadgenumber