标签:des style blog color io os ar 使用 for
if (OSVersion>=8.0) { CLLocationManager *clloc = [[CLLocationManager alloc] init]; [clloc requestAlwaysAuthorization]; }
除了以上的代码,还需要在app的plist文件里面添加两个属性NSLocationAlwaysUsageDescription,NSLocationWhenInUseDescription。这两个属性的value你可以自定义也可以不填。
if(OSVersion>=8.0){//8.0以后使用这种方法来注册推送通知 UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes]; }else{ [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge)]; }
标签:des style blog color io os ar 使用 for
原文地址:http://www.cnblogs.com/dagehaoshuang/p/4040618.html