这段代码在ios 10上运行正常,但是当我提出选择器时,它在ios 11上崩溃了
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];
pickerController.delegate = self;
pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
pickerController.showsCameraControls = YES;
pickerController.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]; // kUTTypeMovie is actually an NSString.
pickerController.videoMaximumDuration = 30.0f; // limits video length to 30 seconds.
[self presentViewController:pickerController animated:YES completion:nil];
}
// Picker Delegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info
{
self.videoURL = info[UIImagePickerControllerMediaURL];
[picker dismissViewControllerAnimated:YES completion: nil];
NSString *str = [self.videoURL absoluteString];
}