我想捕获图像并将其保存在imageview中。以下是代码。IOS图像捕获并保存到UIImageView
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
NSLog(@"Hello");
[picker dismissModalViewControllerAnimated:YES];
[_Image setImage:image];
}
- (IBAction)Capture:(UIButton *)sender {
UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController: cameraUI animated: YES completion:nil];
}
问题是imagepickercontroller根本没有被调用!我的.h声明是
@interface AikyaViewController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
我可以让相机捕捉图像,但图像没有保存在我的imageview中。事实上它并没有进入该功能本身,因为它没有NSlogging。
我是否应该链接故事板中的任何内容或任何代表初始化我是否缺少? Plz引导相同。
检查我的编辑答案 – Ilario