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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:18:14+00:00 2026-05-31T09:18:14+00:00

I am going to ask that one question that perhaps has been already asked

  • 0

I am going to ask that one question that perhaps has been already asked a million times.

I am making an app for iPad and want to give users the ability to multi-select images from their photo-library. I already have a working code for user to select one image at a time. (not what I need)

I have already downloaded and looked into ELC image picker sample code but that code is not compatible with iOS 5 or Xcode 4. i.e. it has ARC and compile problems left and right, its using release and dealloc all over the place.

I am just frustrated that apple hasn’t already created a built in-api for us developers for this most commonly requested functionality in most of our iPhone/ipad apps. (not one but multi-select pics)

Is there any other sample code available? Trust me, I have been googling for a while.

  • 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-31T09:18:15+00:00Added an answer on May 31, 2026 at 9:18 am

    Ok, I have this figured out. The problem with Assets Library is that it gives you all the GEO data of the image. What that means for your users using your app is that they will get a prompt saying that your app is trying to access their location. Infact all you are trying to do is let them choose multiple images from their photo-album. Most users will be turned off thinking its a piracy issue. The best approach is to use apples api of imagePickerController. I know it lets you choose one pic at a time but if you add the following code, it will let you choose multiple pictures.

    The way I am doing is let the users keep selecting pictures they want, keep saving those files in the app documents directory, till they hit the done button. See here my sample code and hopefully it will save you the pain of going through Assets Library

    -(IBAction)selectExitingPicture
    {
        //Specially for fing iPAD
        UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
        imagePicker.delegate = self;
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
    
        popoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
        [popoverController presentPopoverFromRect:CGRectMake(0.0, 0.0, 400.0, 300.0) 
                                 inView:self.view
               permittedArrowDirections:UIPopoverArrowDirectionAny 
                               animated:YES];
    }
    
    //Done button on top
    - (void)navigationController:(UINavigationController *)navigationController
          willShowViewController:(UIViewController *)viewController
                        animated:(BOOL)animated
    {    
        //NSLog(@"Inside navigationController ...");
    
    
        if (!doneButton) 
        {
            doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
                                                          style:UIBarButtonItemStyleDone
                                                         target:self action:@selector(saveImagesDone:)];
        }
    
        viewController.navigationItem.rightBarButtonItem = doneButton;
    }
    
    - (IBAction)saveImagesDone:(id)sender
    {
        //NSLog(@"saveImagesDone ...");
    
        [popoverController dismissPopoverAnimated:YES];
    }
    
    
    -(void)imagePickerController:(UIImagePickerController *)picker
          didFinishPickingImage : (UIImage *)image
                     editingInfo:(NSDictionary *)editingInfo
    {
    
    
        //DONT DISMISS
        //[picker dismissModalViewControllerAnimated:YES];
        //[popoverController dismissPopoverAnimated:YES];
    
            IMAGE_COUNTER = IMAGE_COUNTER + 1;
    
            imageView.image = image;
    
            // Get the data for the image
            NSData* imageData = UIImageJPEGRepresentation(image, 1.0);
    
    
            // Give a name to the file
            NSString* incrementedImgStr = [NSString stringWithFormat: @"UserCustomPotraitPic%d.jpg", IMAGE_COUNTER];
    
    
            NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
            NSString* documentsDirectory = [paths objectAtIndex:0];
    
            // Now we get the full path to the file
            NSString* fullPathToFile2 = [documentsDirectory stringByAppendingPathComponent:incrementedImgStr];
    
            // and then we write it out
            [imageData writeToFile:fullPathToFile2 atomically:NO];
    
    }
    

    //Now use this code to get to user selected pictures. Call it from wherever you want in your code

     NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES);
            NSString* documentsPath = [paths objectAtIndex:0];
            NSString* dataFile = [documentsPath stringByAppendingPathComponent:@"UserCustomPotraitPic1.jpg"];
    
            NSData *potraitImgData = [NSData dataWithContentsOfFile:dataFile];
            backgroundImagePotrait = [UIImage imageWithData:potraitImgData];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an alarm clock app and I am going to ask that
I hope that this one is not going to be ask-and-answer question... here goes:
I am going to ask a question that might sound weird. Is there a
I have a question that I'm ashamed to ask, but I'm going to have
I am going to totally re-ask this question. So this is one big edit
I have a feeling that I am going to ask a stupid question, yet
I was going to Ask a Question earlier today when I was presented to
I was going to ask a question here about whether or not my design
I was going to ask a question about preparing a desktop application to support
Well I was going to ask what the difference is but it's been answered

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.