本文介绍了UIImagePickerControllerDelegate 没有正确响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 iPhone 3Gs 上使用 iOS 4.2.1 中的 UIImagePickerController.我以前使用过不推荐使用的方法
I'm using the UIImagePickerController in iOS 4.2.1 on an iPhone 3Gs. I've previously used the deprecated method
- (void)imagePickerController: didFinishPickingImage: editingInfo:
没有问题.我有另一个应用在另一个应用中使用新的 didFinishPickingMediaWithInfo API,一旦选择了媒体,选择器就永远不会调用该方法.
without a problem. I have another app using the new didFinishPickingMediaWithInfo API in another app, and the method is never getting called by the picker once media is chosen.
//MyViewController.h
@interface MyViewController : UIViewController < UIImagePickerControllerDelegate, UINavigationControllerDelegate>
//MyViewController.m
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
UIImagePickerController *picker = [[UIImagePickerController new] autorelease];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
picker.allowsEditing = NO;
[self presentModalViewController:picker animated:TRUE];
}
- (void)imagePickerController:(UIImagePickerController *)picker imagePickerController:didFinishPickingMediaWithInfo:(NSDictionary *)editingInfo{
//**NEVER CALLED**
}
推荐答案
你有
- (void)imagePickerController:(UIImagePickerController *)picker imagePickerController:didFinishPickingMediaWithInfo:(NSDictionary *)editingInfo
你可能想要的地方
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
这篇关于UIImagePickerControllerDelegate 没有正确响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!