Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8965607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:50:38+00:00 2026-06-15T16:50:38+00:00

How do I save a UIImagePickerController camera image so I can send to CreateViewController

  • 0

How do I save a UIImagePickerController camera image so I can send to CreateViewController scene’s UIImageView?

HomeViewController(scene 1) has a button that loads UIImagePickerController and returns with an image from the camera. CreateViewController(scene 2) has an empty UIImageView.

HomeViewController.h

#import "CreateViewController.h"

@interface HomeViewController : UIViewController
<UIImagePickerControllerDelegate, UINavigationControllerDelegate>

@property (strong, nonatomic) UIImagePickerController *imagePicker;
@property(nonatomic, retain) UIImage *myImage;

- (IBAction)cameraImage:(id)sender;

HomeViewController.m

@implementation HomeViewController
@synthesize imagePicker, myImage;

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

if ( [segue.identifier isEqualToString:@"create"]) {
    CreateViewController *cvc = [segue destinationViewController];
    UIImage *image = myImage;
    cvc.myImage = image;

}
}

//Camera button action
- (IBAction)cameraImage:(id)sender{
//UIImagePickerController space in memory
imagePicker = [[UIImagePickerController alloc]init];
//Set the delegate
imagePicker.delegate = self;
//Set the sourceType
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
//Show Image Picker UI
[self presentViewController:imagePicker animated:YES completion:^{}];
}

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

self.myImage = [info objectForKey:UIImagePickerControllerOriginalImage];

[self dismissViewControllerAnimated:YES completion:^{}];

[self performSegueWithIdentifier:@"create" sender:self];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissViewControllerAnimated:YES completion:^{}];
}

CreateViewController.h

@property (strong, nonatomic) IBOutlet UIImageView *bgImage;
@property(nonatomic, retain) UIImage *myImage;

CreateViewController.m

@implementation CreateViewController
@synthesize bgImage, myImage;

- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *image = myImage;
[bgImage setImage:image];
}

Download sample code here; http://code-blind.com/ios6-camera-picture-to-another-scenes-uiimageview/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:50:39+00:00Added an answer on June 15, 2026 at 4:50 pm

    Using a segue is not mandatory if you are instanciating the controller programmatically.

    The easiest way to achieve that is something like

    -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    
        [picker dismissViewControllerAnimated:YES completion:nil];
        UIImage * pickedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
        DisplayViewController * controller = [DisplayViewController new];
        controller.imageView.image = pickedImage;
        [self.navigationController pushViewController:controller animated:YES];
    }
    

    If you want to use a segue you need to manually invoke it by doing

    [self performSegueWithIdentifier:@"your-segue-name" sender:self];
    

    then you can use an ivar in your HomeViewController to store the pickedImage and pass it to your destinationViewController.

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {    
        DisplayViewController * controller = (DisplayViewController *)segue.destinationViewController;
        controller.imageView.image = _pickedImage;
    }
    

    where _pickedImage is the ivar where you stored the image after it has been picked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using UIImagePickerController class to capture image from camera. When is captured, I save
I wanted to save an image that has been taken to the application documents
Trying to select image using photo picker and save that image internally in apps
I try to save a image from camera or photo album into application directory.
I have an UIImagePickerController and I would like to save a selected image to
I am using UIImagePickerController in an iOS app to save an image in context
is ti possibile to save a picture (taken with UIImagePickerController) in the camera roll,
So I'm trying to save an image taken from UIImagePickerController to NSUserDefaults so I
Save one image path in the database... and whenever a call is made to
I save a custom object in NSUserDefults the object has more than one property

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.