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 4339262
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:11:35+00:00 2026-05-21T11:11:35+00:00

I am new to Iphone development and got a situation where I need to

  • 0

I am new to Iphone development and got a situation where I need to have a ViewController named PhotoSelectorViewController which will ask for one to pick images from phone library. I know UIImagePickerController is there but I don’t know how to use it correctly.

I tried following:

First Method:

  1. I created a ViewController named PhotoSelectorViewController with xib file.
  2. I remove View from xib file and added UIImagePickerController to the list.
  3. I don’t know what to do next to start the picker when one will create the instance of this class calling some init function in this ViewController.

Second Method:

  1. I created new project and added a view controller named PhotoSelectorViewController where there is a Window and a UIView only.
  2. On UIView viewDidLoad function I am creating instance of UIImagePickerController and adding it to the view.
  3. I don’t know how this picker will be started when one will create instance of this view controller?

Please help if you can.

  • 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-21T11:11:36+00:00Added an answer on May 21, 2026 at 11:11 am

    The easiest way is to present it modally from the calling View Controller.

    So, for instance, if you have a button on MyController called showPhotos:

    -(IBAction)showPhotos:(id)sender {
        UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
        imagePicker.delegate = self;
        imagePicker.allowsEditing = YES;
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentModalViewController:imagePicker animated:YES];
    }
    

    Then, you need to implement

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

    in this same controller as it (in my example) was set to be the delegate.

    allowsEditing allows the user to pan, zoom and crop the image before use. Just set to NO if you don’t wish to allow that.

    Inside your delegate method, the dictionary contains the resulting UIImage. You can obtain via

    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];

    or

    UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage]; if you allow editing.

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

Sidebar

Related Questions

Very new to Iphone development here, I have a project which is successfully building
I'm new in iPhone Development. I'm creating an application in which i need to
I am new to iPhone development. I've seen many applications, which have their settings
I'm new to iPhone development,currently i have to develop my application as dynamic one,Where
Im new to iPhone development and I have really taken this to me. I
I am new to iphone development.I have created map applications and displayed the cuurent
I am new to iPhone development. I have been looking at samples and made
I am new to iphone development.I want to add RegexKitLite framework.I have downloaded the
I am new to iphone development. I have created grouped table and display the
Hello i am new in iphone development, I have some doubt about this ,

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.