【问题标题】:UIImagePickerController crashes on iPad simulatorUIImagePickerController 在 iPad 模拟器上崩溃
【发布时间】:2013-01-04 11:09:24
【问题描述】:

我正在尝试在弹出窗口中显示 UiImagePicker,因为它应该为 iPad 完成。 But when a picture is selected and imagePickerController:didFinishPickingMediaWithInfo: is triggered, I get the following log:

找不到命名服务“com.apple.PersistentURLTranslator.Gatekeeper”。 assetsd 已关闭或配置错误。事情不会像你期望的那样进行。

这是我的代码:

- (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];
}

我可能遗漏了什么或做错了什么?谢谢!

【问题讨论】:

    标签: ios ipad crash uiimagepickercontroller uipopovercontroller


    【解决方案1】:

    这可能是 Xcode for ML 中的 bug。尝试退出模拟器并重新启动,看看是否有帮助。

    【讨论】:

    • 谢谢,它似乎是这样的......如果我在打开项目后第一次在 iPhone 模拟器上运行应用程序,我会在 iPad 模拟器上收到这样的日志消息,反之亦然。我尝试在真实设备上运行,它可以工作。
    猜你喜欢
    • 1970-01-01
    • 2013-10-08
    • 2013-09-27
    • 1970-01-01
    • 1970-01-01
    • 2012-10-25
    • 2023-03-12
    • 2013-11-22
    • 2011-12-26
    相关资源
    最近更新 更多