[英]UIImagePickerController crashes on iPad simulator
I'm trying to display a UiImagePicker in a popover, as it is supposed to be done for iPad. 我正在尝试在弹出窗口中显示UiImagePicker,因为它应该在iPad上完成。 But when a picture is selected and imagePickerController:didFinishPickingMediaWithInfo: is triggered, I get the following log:
但是当选择图片并触发imagePickerController:didFinishPickingMediaWithInfo:时 ,我得到以下日志:
Named service 'com.apple.PersistentURLTranslator.Gatekeeper' not found. 找不到名为“ com.apple.PersistentURLTranslator.Gatekeeper”的服务。 assetsd is down or misconfigured.
资产已关闭或配置错误。 Things will not work the way you expect them to.
事情不会像您期望的那样运作。
This is my code: 这是我的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.allowsEditing = NO;
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// Check device
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
[self dismissModalViewControllerAnimated:YES];
}
else {
[popoverController dismissPopoverAnimated:YES];
}
// More code here to save the selected image
}
- (IBAction)showImagePicker:(id)sender
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
[self presentModalViewController:imagePickerController animated:YES];
}
else {
popoverController=[[UIPopoverController alloc]
initWithContentViewController:imagePickerController];
[popoverController presentPopoverFromRect:((UIButton *)sender).frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
}
What could I be missing or doing wrong? 我会丢失什么或做错什么? Thanks!
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.