我希望在应用'视频'中加载ipod / iphone库中的视频。 代码显示如下,但它总是导致崩溃
UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.sourceType= UIImagePickerControllerSourceTypePhotoLibrary;
picker.mediaTypes = [NSArray arrayWithObject:kUTTypeMovie];
picker.delegate = self;
欢迎任何评论
由于
interdeb
答案 0 :(得分:0)
我们需要知道你是如何呈现它的,以及它碰巧在你的代码中崩溃的行的信息。这是一个适合我的例子:
- (void)presentVideoPicker:(UIImagePickerControllerSourceType)sourceType
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = [self retain];
picker.mediaTypes = [NSArray arrayWithObjects:(NSString*)kUTTypeMovie, kUTTypeImage, nil];
picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
picker.allowsEditing = YES;
picker.sourceType = sourceType;
[self.view.window.rootViewController presentModalViewController:picker animated:YES];
[picker release];
}
我发送了UIImagePickerControllerSourceTypeCamera
或UIImagePickerControllerSourceTypePhotoLibrary