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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:35:12+00:00 2026-05-28T13:35:12+00:00

Using presentModalViewController with UIImagePickerController causing Crash on iOS 5 (its running fine on version<5),

  • 0

Using presentModalViewController with UIImagePickerController causing Crash on iOS 5 (its running fine on version<5), i am trying to get all the albums on the device, using ‘UIImagePickerControllerSourceTypeSavedPhotosAlbum’ is only getting the Camera images, so when i change the sourceType to ‘UIImagePickerControllerSourceTypePhotoLibrary’ it crashes, i appreciate any help, here is my code:

float version = [[[UIDevice currentDevice] systemVersion] floatValue];
    if(version < 5) 
        imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    else                        
        imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        //imgPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

    [self presentModalViewController:imgPicker animated:YES];
  • 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-28T13:35:13+00:00Added an answer on May 28, 2026 at 1:35 pm

    From the official doc:

    To use an image picker controller containing its default controls, perform these steps:

    1. Verify that the device is capable of picking content from the desired source. Do this calling the isSourceTypeAvailable: class method, providing a constant from the “UIImagePickerControllerSourceType” enum.

    2. Check which media types are available, for the source type you’re using, by calling the availableMediaTypesForSourceType: class method. This lets you distinguish between a camera that can be used for video recording and one that can be used only for still images.

    3. Tell the image picker controller to adjust the UI according to the media types you want to make available—still images, movies, or both—by setting the mediaTypes property.

    4. Present the user interface by calling the presentViewController:animated:completion: method of the currently active view controller, passing your configured image picker controller as the new view controller.

      On iPad, present the user interface using a popover. Doing so is valid only if the sourceType property of the image picker controller is set to UIImagePickerControllerSourceTypeCamera. To use a popover controller, use the methods described in “Presenting and Dismissing the Popover” in UIPopoverController Class Reference.

    5. When the user taps a button to pick a newly-captured or saved image or movie, or cancels the operation, dismiss the image picker using your delegate object. For newly-captured media, your delegate can then save it to the Camera Roll on the device. For previously-saved media, your delegate can then use the image data according to the purpose of your app

    Maybe point 4 is causing troubles.

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

Sidebar

Related Questions

I'm trying to present a UIImagePickerController from a UITableViewController subclass using the following code:
I'm using the UIImagePickerController in iOS 4.2.1 on an iPhone 3Gs. I've previously used
I am trying to access Photo Album using the following code. It works fine
I am trying to display a login screen using presentModalViewController on iPad. LoginFormController *controller
I am using UIImagePickerController in an iOS app to save an image in context
Using online interfaces to a version control system is a nice way to have
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
I am using the UIImagePickerController in order to let the user select an image
i have a little problem with dismissing my camera view. im using the UIImagePickerController
I am using the camera in a fax type iOS application in which case

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.