我正在使用以下代码在模拟器上选择视频:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) // for ipad only
{
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = NO;
imagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
imagePicker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie, nil];;
popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
[popover presentPopoverFromBarButtonItem:[self.navigationItem.rightBarButtonItems objectAtIndex:0] permittedArrowDirections: UIPopoverArrowDirectionAny animated:YES];
}
在选择视频并单击“使用”按钮之前,一切都很好。此时,我得到“压缩视频”指示器,模拟器将锁定,必须重新启动。委托永远不会被调用,调试器只会显示“正在运行”,永远不会返回。
我的问题是:
(a) 代码有什么明显的问题,
(b) 注意到几篇关于 UIImagePickerController 和模拟器的帖子(但没有一个像我的那样)是否有人知道模拟器中是否存在可能的错误造成这种情况。这是 6.1 模拟器。