【发布时间】:2011-03-24 18:37:42
【问题描述】:
我在某些设备上遇到一个奇怪的问题 UIImagePickerController 没有触发委托方法 didFinishPickingImage 或 didFinishPickingMediaWithInfo。
我已在 iphone 4 iOS 4.1、iPod 4g 和 iphone 4.3 应用程序上测试该应用程序运行正常,并且委托方法运行正常。
但在 iphone 3gs iOS 4.1 和 iphone 4 iOS 4.3 的某些设备上,这些事件不会触发。
设备播放拍照的声音,然后显示图像进行编辑,当我们按下USE按钮相机再次打开时。
我也尝试在拍照后禁用图像编辑模式,但没有帮助。
谁能帮我看看为什么会这样?
这是我正在使用的代码:
-(void)startCamera
{
picker = [[UIImagePickerController alloc] init];
picker.allowsEditing = YES;
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = YES;
[self presentModalViewController: picker animated: YES];
[picker release];
}
// IOS 4
//- (void) imagePickerController: (UIImagePickerController*) pickerController didFinishPickingMediaWithInfo: (NSDictionary*) info
// IOS 3
- (void)imagePickerController:(UIImagePickerController *)pickerView didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
btnCamera.enabled = YES;
hasTakenImage = YES;
btnRetake.hidden = NO;
btnUpload.hidden = NO;
// imgItem.image = [info objectForKey: UIImagePickerControllerOriginalImage];
imgItem.image = image;
// ADD: dismiss the controller (NB dismiss from the *reader*!)
[pickerView dismissModalViewControllerAnimated: YES];
[self dismissModalViewControllerAnimated: YES];
}
非常感谢
【问题讨论】:
标签: iphone uiimagepickercontroller