0

我在 UIpopupviewController 中调用了 IOS 相机,有时我可以在第一次调用它崩溃后的某个时间拍摄超过 2 张照片。

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    UIImage *image=[info objectForKey:UIImagePickerControllerOriginalImage];
    UIImageWriteToSavedPhotosAlbum (image, nil, nil , nil);

    [self dismissViewControllerAnimated:NO completion:nil];

}

-(IBAction)takephoto:(id)sender {

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        UIImagePickerController *imagePicker=[[UIImagePickerController alloc]init];
        imagePicker.delegate=self;
        imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera;
        imagePicker.allowsEditing=NO;
        [self presentModalViewController:imagePicker animated:NO];

    }
}

在此处输入图像描述

4

0 回答 0