I have a UIImagePickerController in my app which uses a didFinishPickingMediaWithInfo delegate to monitor whether the user has picked an image.
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
UIImage *image = [info
objectForKey:UIImagePickerControllerOriginalImage];
}
[picker dismissModalViewControllerAnimated:YES];
}
When [picker dismissModalViewControllerAnimated:YES] is called, it will dismiss the current UIImagePickerController view and go back to the view before the UIImagePicker is displayed. I want to set a delegate to send back the selected image to the previous view when the dismissModalVewControllerAnimated is called. How do I do that? Many thanks!