Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIImagePickerController在iPad模拟器上崩溃_Ios_Ipad_Crash_Uiimagepickercontroller_Uipopovercontroller - Fatal编程技术网

Ios UIImagePickerController在iPad模拟器上崩溃

Ios UIImagePickerController在iPad模拟器上崩溃,ios,ipad,crash,uiimagepickercontroller,uipopovercontroller,Ios,Ipad,Crash,Uiimagepickercontroller,Uipopovercontroller,我正试图在一个popover中显示一个UiImagePicker,就像iPad应该做的那样。但当选择图片并触发imagePickerController:didFinishPickingMediaWithInfo:时,我会得到以下日志: 找不到命名服务“com.apple.PersistentURLTranslator.Gatekeeper”。assetsd已关闭或配置错误。事情不会按你期望的方式进行。 这是我的代码: - (void)viewDidLoad { [super viewDi

我正试图在一个popover中显示一个UiImagePicker,就像iPad应该做的那样。但当选择图片并触发imagePickerController:didFinishPickingMediaWithInfo:时,我会得到以下日志:

找不到命名服务“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];
}

我会错过什么或做错什么?谢谢

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

谢谢,似乎是这样的。。。如果我在打开项目后第一次在iPhone模拟器上运行应用程序,我会在iPad模拟器上收到这样的日志消息,反之亦然。我试着在真正的设备上运行,它工作了。