//如果沒有權限,iOS10以下用彈窗提醒;iOS10直接跳到“設置”中去
- (void)cameraAuthorizationAlert {
? ? NSString *versionNum = [[UIDevice currentDevice] systemVersion];
? ? NSLog(@"版本號:%@",versionNum);
? ? if([versionNumfloatValue] >=10.0) {
? ? ? ? // 無權限 引導去開啟
? ? ? ? NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
? ? ? ? if ([[UIApplication sharedApplication]canOpenURL:url]) {
? ? ? ? ? ? [[UIApplication sharedApplication]openURL:url];
? ? ? ? }
? ? }
? ? else{
? ? ? ? UIAlertView*alert = [[UIAlertViewalloc]initWithTitle:@"提示"? message:@"’微模識’需要訪問您的相機,是否去設置?"? delegate:selfcancelButtonTitle:@"取消"otherButtonTitles:@"確定",nil];
? ? ? ? [alertshow];
? ? }
}