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