简体   繁体   English

iPhone OS 3.0中的UIImagePickerController

[英]UIImagePickerController in iPhone OS 3.0

I am using iPhone OS 3.0 SDK. 我正在使用iPhone OS 3.0 SDK。 My requirement is that I want to get the image from the photo albums library and display it on an image view. 我的要求是我想从相册库中获取图像并将其显示在图像视图上。 I am using the UIImagePickerController for that. 我为此使用UIImagePickerController

But the problem is the - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)imageeditingInfo:(NSDictionary *)editingInfo delegate method is deprecated in iPhone OS 3.0 , 但是问题是-iPhone OS 3.0中不推荐使用- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)imageeditingInfo:(NSDictionary *)editingInfo委托方法,

Is there any alternative for getting the Image from the UIImagePickerController. 是否有其他方法可以从UIImagePickerController获取图像。

All suggestions are highly appreciated. 所有建议都受到高度赞赏。

Thanks... 谢谢...

use this delegate method of UIImagePickerController in your implementation file. 在实现文件中使用UIImagePickerController的此委托方法。

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    [picker dismissModalViewControllerAnimated:YES];
    imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}

and don't forget to modify your header file with these two protocols 并且不要忘记使用这两种协议来修改头文件

@interface photoAppViewController : UIViewController < UIImagePickerControllerDelegate,UINavigationControllerDelegate >

Speaking of 3.0 here would break your and my NDA with Apple. 在这里提到3.0会破坏您和我与Apple的保密协议。 However I can suggest that you look at the relevant header files ( mdfind didFinishPickingImage | grep 3.0 will find what you need quickly). 但是,我建议您查看相关的头文件( mdfind didFinishPickingImage | grep 3.0将迅速找到所需的文件)。

Some one posted me the answer as below. 有人向我发布了如下答案。

In UIImagePickerController.h you can see that there ist a method you can use: 在UIImagePickerController.h中,您可以看到可以使用的一种方法:

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info;

The documentation does not show this method it is only in the .h file. 文档没有显示此方法,仅在.h文件中。

but I am still not getting the above method in the .h file 但我仍然没有在.h文件中获得上述方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM