我在 iPad 模拟器上工作,我想在 iPad 照片库中查看图像,但它有问题:
'NSInvalidArgumentException',原因:'在 iPad 上,UIImagePickerController 必须通过 UIPopoverController 呈现'
这是我的代码。帮我!
- (IBAction)ShowGallery:(id)sender {
if([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary]) {
picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
}