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

The Archive Base Latest Questions

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

I have a folder with pictures in my project and i like to know

  • 0

I have a folder with pictures in my project and i like to know how i could put this pictures from the folder into a array

How should i do that?

I tried this to put the images in the array

    UIImage*image = [[NSBundle mainBundle]pathsForResourcesOfType:@"jpg" @"jpeg" @"gif" inDirectory:@"Images"];
    NSArray*images = [[NSMutableArray alloc]initWithContentsOfFile:image];
  • 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:16:54+00:00Added an answer on June 15, 2026 at 4:16 pm

    You could do the following, getting the array of filenames and then filling another array with the images, themselves (assuming that’s what you were trying to do).

    NSMutableArray *imagePaths = [[NSMutableArray alloc] init];
    NSMutableArray *images = [[NSMutableArray alloc] init];
    
    NSArray *imageTypes = [NSArray arrayWithObjects:@"jpg", @"jpeg", @"gif", nil];
    
    // load the imagePaths array
    
    for (NSString *imageType in imageTypes)
    {
        NSArray *imagesOfParticularType = [[NSBundle mainBundle]pathsForResourcesOfType:imageType 
                                                                            inDirectory:@"Images"];
        if (imagesOfParticularType)
            [imagePaths addObjectsFromArray:imagesOfParticularType];
    }
    
    // load the images array
    
    for (NSString *imagePath in imagePaths)
        [images addObject:[UIImage imageWithContentsOfFile:imagePath]];
    

    As an aside, unless these are tiny thumbnail images and you have very few, it generally would not be advisable to load all the images at once like this. Generally, because images can take up a lot of RAM, you would keep the array of filenames, but defer the loading of the images until you really need them.


    If you don’t successfully retrieve your images, there are two questions:

    1. Are the files included in my bundle? When you select the “Build Phases” for your Target’s settings and expand the “Copy Bundle Resources” (see the image below), do you see your images included? If you don’t see your images in this list, they won’t be included in the app when you build it. To add your images, click on the “+” and add them to this list.

      enter image description here

    2. Are the files in a “group” or in an actual subdirectory? When you add files to a project, you’ll see the following dialog:

      enter image description here

      If you chose “Create folder references for added folders”, then the folder will appear in blue in your project (see the blue icon next to my “db_images” folder in the preceding screen snapshot). If you chose “create groups for added folders”, though, there will be the typical yellow icon next to your “Images” group. Bottom line, in this scenario, where you’re looking for images in the subdirectory “Images“, you want to use the “Create folder references for added folders” option with the resulting blue icon next to the images.

    Bottom line, you need to ensure the images are in your app bundle and that they are where you think they are. Also note that iOS is case sensitive (though the simulator is not), so make sure you got the capitalization of “Images” right.

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

Sidebar

Related Questions

I have this arborescence: Project Folder build Project ProjectTests Pictures In the sub-folder Project
I have documents scanned as .jpg pictures in a folder and I would like
I my project I have a class that in this class I want to
I have a WPF Application project directory like this Actually i have added a
I have folder structure and I would like to create JSON objects based on
I have folder home/admin. In this folder there is index.php. When i access to
I have folder on which i want to apply security like the current user
I have a folder with some dotfiles I would like to make symlinks for.
Anybody know a workaround for this problem described under: When you add the folder
i have the resources shared with another project. The pictures of the products i

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.