I am developing an application that uses the camera. I am using browsing option to browse the photos from the gallery. I am also presenting the option to take a photo if required. For getting the selected photo while browsing I have implemented UIImagePickerControllerDelegate method:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo
{
[self dismissModalViewControllerAnimated:YES];
imageView.image = img;
}
I am getting the selected image in this method. But how can I get the image captured by the camera in my imageView without saving it into the gallery? Will I get the image in the same method?
You are using
imagePickerController:didFinishPickingImage:editingInfo:. This is deprecated in ios 3.0. Refer UIImagePickerControllerDelegate also refer this link why not to use deprecated methods.you have to use
imagePickerController:didFinishPickingMediaWithInfo:as follows:this will work for both of your camera and Photo gallery. You also don’t need to save image captured using camera. You can directly assign it to your image view as this code is doing.
Hope this helps you.