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

  • SEARCH
  • Home
  • 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 7639863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:31:55+00:00 2026-05-31T08:31:55+00:00

-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info { [self dismissModalViewControllerAnimated:YES]; UIImage *image = [info objectForKey: UIImagePickerControllerOriginalImage]; if(imageView1.image == nil){

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


    [self dismissModalViewControllerAnimated:YES];

    UIImage *image = [info objectForKey: UIImagePickerControllerOriginalImage];

    if(imageView1.image == nil){
        imageView1.image = image;
    }
    else if(imageView2.image == nil){
        imageView2.image = image;
    }
    else if(imageView3.image == nil){
        imageView3.image = image;
    }

    //pickedImage = TRUE;
}

I have this code and it never go to the second “if else” statement.
Although it assigns the image to imageView1, next time the imageView1.image is still null.
What am I doing wrong here?

Thanks in advance.

  • 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-05-31T08:31:56+00:00Added an answer on May 31, 2026 at 8:31 am

    I have two solutions now.

    1.Try this

    UIImage *image = [info valueForKey:UIImagePickerControllerOriginalImage];
    

    use “valueForKey” instead of objectForKey

    2. You have to dismiss and release the UIImagePickerController before you try to do anything with the info dictionary. To be super-clear:

    This WILL NOT WORK:

    - (void)imagePickerController:(UIImagePickerController *)picker 
                          didFinishPickingMediaWithInfo:(NSDictionary *)info {    
    
      myUIImageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
    
    
      [picker dismissModalViewControllerAnimated:YES];
      [picker release];
    }
    

    THIS WILL WORK

    - (void)imagePickerController:(UIImagePickerController *)picker 
                          didFinishPickingMediaWithInfo:(NSDictionary *)info {
    
      [picker dismissModalViewControllerAnimated:YES];
      [picker release];
    
    
      myUIImageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
    
            if(imageView1.image == nil){
                imageView1.image = image;
            }
            else if(imageView2.image == nil){
              imageView2.image = image;
            }
           else if(imageView3.image == nil){
            imageView3.image = image;
          }             
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *tempImage = [info objectForKey:UIImagePickerControllerOriginalImage]; imgview.image = tempImage; [self
I'm using the following code in my UIImagePickerController delegate: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
Mysterious (at least to me) issue. Here's what I'm doing - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary
- (void)viewDidUnload { self.GPSArray = nil; self.accelerometerArray = nil; self.headingArray = nil; self.managedObjectContext =
I 'm new to xcode. I try to select an image from the UIImagePickerController
I create the picker: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate
Hi I have had a working UIImage picker controller and suddenly it now only
I'm having trouble with using a UIImagePickerController. Basically, though the picker is being displayed
I am using UIImagePickerController in an iOS app to save an image in context
i have the problem with the select the image from UIImagePickerController in ipad in

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.