//创建提示视图控制器
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@”提示” message:@”请打开定位” preferredStyle:UIAlertControllerStyleAlert]; //这里样式是表单还是警告视图
//创建提示框按钮
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
}];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
[alert addAction:action1];
[alert addAction:action2];
//模态跳转
[self presentViewController:alert animated:YES completion:nil];
编码问题解决:
//解决编码问题
// 原 path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
iOS9: path =[NSString stringWithCString:[path cStringUsingEncoding:NSUTF8StringEncoding] encoding:NSNonLossyASCIIStringEncoding];