我想捕獲圖像並將其保存在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