UIImagePickerController在iPad中崩溃 [英] UIImagePickerController crashes in iPad
本文介绍了UIImagePickerController在iPad中崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-(IBAction)selectPressed:(id)sender
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];
}
我正在iPad和iPhone模拟器上测试此代码。在iPhone模拟器中(以及在真正的iPhone上)它没问题 - 画廊出现了。但是在iPad模拟器上(我没有设备),它崩溃了。有什么想法?
I am testing this code on iPad and iPhone simulators. In the iPhone simulator (and on real iPhones too) it's ok - gallery appears. But on the iPad simulator (I don't have a device), it crashes. Any ideas why?
推荐答案
请阅读设备日志中的异常消息:
Please read the exception messages in the device log:
在iPad上,必须通过UIPopoverController呈现UIImagePickerController
这篇关于UIImagePickerController在iPad中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文