我正在尝试使用以下代码访问相册。它在我低于 4.0 版本的 iPhone 或 iPad 上运行良好。
- (void)BrowsePhotoLibrary:(id)sender {
NSArray *types = [UIImagePickerController availableMediaTypesForSourceType:
UIImagePickerControllerSourceTypePhotoLibrary];
if ([types containsObject:(id)kUTTypeMovie])
{
UIImagePickerController *imgPickerController = [[[UIImagePickerController alloc] init] autorelease];
imgPickerController.delegate = self;
imgPickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgPickerController.mediaTypes = [NSArray arrayWithObject:(id)kUTTypeMovie];
[self presentModalViewController:imgPickerController animated:YES];
}
}
如果相册中至少有一个视频可用,则相同的代码在 iPad 2 4.3 版本中崩溃,如果相册没有任何视频,则相同的代码会启动到相册。有人可以告诉这里可能是什么原因吗?