文档注释
/**
set to 0 to hide. default is 0. In iOS 8.0 and later,
your application must register for user notifications
using -[UIApplication registerUserNotificationSettings:]
before being able to set the icon badge.
*/
// 应用头像上的数字 默认情况下为0 ,没有数字
// 如果不是0 就会显示出来
代码
// iOS 8.0 之后修改应用图标上的数字,需要获取请求用户的授权,以下是授权代码。
UIUserNotificationCategory *category = [[UIUserNotificationCategory alloc] init];
NSSet *set = [NSSet setWithObject:category];
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:set];
[app registerUserNotificationSettings:settings];
app.applicationIconBadgeNumber = 10;