Ios UIImagePickerController在iPad模拟器上崩溃
我正试图在一个popover中显示一个UiImagePicker,就像iPad应该做的那样。但当选择图片并触发imagePickerController:didFinishPickingMediaWithInfo:时,我会得到以下日志: 找不到命名服务“com.apple.PersistentURLTranslator.Gatekeeper”。assetsd已关闭或配置错误。事情不会按你期望的方式进行。 这是我的代码: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
- (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模拟器上收到这样的日志消息,反之亦然。我试着在真正的设备上运行,它工作了。