简体   繁体   English

UIImagePickerController在iPad模拟器上崩溃

[英]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! 谢谢!

This could be a bug in Xcode for ML. 这可能是Xcode for ML中的错误 Try to quit the simulator and restart and see if it helps. 尝试退出模拟器并重新启动,看看是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UIImagePickerController使iPad上的应用程序崩溃,但iPhone崩溃 - UIImagePickerController crashes app on iPad but not iPhone 在iPad Simulator上可用,但在iPad上崩溃 - Works on iPad Simulator but crashes on iPad 应用程序在iPad上崩溃但在iPad模拟器中没有崩溃 - App crashes on iPad but not in iPad Simulator 应用程序在iPhone上崩溃,但在模拟器或iPad上没有崩溃? - App crashes on iPhone but not simulator or iPad? 获取openGL图像-在模拟器中运行,在iPad上崩溃 - Getting an openGL image - runs in simulator, crashes on iPad 应用程序在iPad设备上崩溃,但在模拟器上工作 - App crashes on iPad device but working on simulator 在drawAtPoint期间崩溃,代码在iPad Air,iPad模拟器上工作,在iPad 1和iPad mini上崩溃 - Crash during drawAtPoint, code works on iPad Air, iPad simulator, crashes on iPad 1 and iPad mini Codename One应用程序适用于模拟器和Android,但在iPad和iphone上崩溃 - Codename One application works on simulator and Android but crashes on iPad and iphones iOS-应用程序在预配置的iPad上崩溃,在模拟器中正常运行 - iOS - app crashes on provisioned iPad, works ok in simulator 在iphone模拟器上使用UIImagePickerController - Use the UIImagePickerController on a iphone simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM