0
我在开发iPad应用程序时尝试访问照片库时遇到问题。但是,相同的代码适用于iPhone开发。其中产生的错误是:如何访问ipad应用程序的照片库
On iPad, UIImagePickerController must be presented via UIPopoverController
我使用为iPad开发了下面的代码:
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];
}
什么是错误?给我们一些更多的信息可以帮助。 – Devraj 2011-04-28 07:21:44
控制台上显示的错误是: – 2011-04-28 07:25:18
异常'NSInvalidArgumentException',原因:'在iPad上,必须通过UIPopoverController呈现UIImagePickerController' – 2011-04-28 07:25:23