ios11调用系用相册崩溃
AlertVC的弹出样式设置为alert会崩溃,设置应该为actionsheet
- (void)changePhotoImg {
UIAlertController * sheetController = [UIAlertController alertControllerWithTitle:@"请选择照片"message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction * Cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction * Done = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self selectImageSourceType:UIImagePickerControllerSourceTypeCamera];
}];
UIAlertAction * Destructive = [UIAlertAction actionWithTitle:@"从相册选择头像" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self selectImageSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}];
[sheetController addAction:Cancel];
[sheetController addAction:Done];
[sheetController addAction:Destructive];
[self presentViewController:sheetController animated:YES completion:nil];
}
更多问题,欢迎加群讨论:qq群 :565191947