需求:創建類似於IOS通訊錄的應用
過程:
1、三個tableviewController視圖:一個rootview,一個editview,一個detailview
在iOS8中設置application badge value 會拋錯:Attempting to badge the application icon but haven't received permission from the user to badge the
原因是因爲在ios8中,設置應用的application badge value需要得到用戶的許可。使用如下方法諮詢用戶是否許可應用設置application badge value
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
在這之前要判斷系統是否爲iOS8的系統,否則8之前的系統會報錯。