当allowEditing = NO时,UIImagePickerController返回图像nil;并在iPad上运行2倍

时间:2012-04-20 18:51:54

标签: iphone objective-c xcode

- (IBAction) buttonAction:(id) sender {
 if (self.picker == nil) {   
        self.picker = [[UIImagePickerController alloc] init];
        self.picker.delegate = self;
        self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        self.picker.allowsEditing = NO;     }  [self.navigationController presentModalViewController:_picker
    animated:YES];     

}

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

    [self dismissModalViewControllerAnimated:YES];
    
    UIImage *myImage = (UIImage *) [info
    objectForKey:UIImagePickerControllerOriginalImage]; 
    
     if (myImage == nil) NSLog(@"Image nil");
    
    }
    

它在iPhone设备上运行良好,但在iPhone 2x模式下无法在iPad上运行 错误? 或者我错了?

0 个答案:

没有答案