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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:00:35+00:00 2026-05-29T06:00:35+00:00

I have an images group inside my xCode project. I am trying to get

  • 0

I have an images group inside my xCode project. I am trying to get all the files from inside that folder into my app.

 NSFileManager *fm = [NSFileManager defaultManager];
    NSArray *dirContents = [fm contentsOfDirectoryAtPath:@"/Images/" error:nil];

The above code always returns an empty array. I added the group in xCode 4.2 by right click and then “New Group”.

  • 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-29T06:00:36+00:00Added an answer on May 29, 2026 at 6:00 am

    The path you are using is probably not the correct one. /Images/ will refer to images in the root of your sandbox. If the images in your folder are added as a resource in your project, they will be stored in the Resources directory in your app, probably not even in the Images directory.

    You also want to read the error to see what’s wrong. That’s what it is for:

    NSErorr *error = nil;
    NSArray *dirContents = [fm contentsOfDirectoryAtPath:@"/Images/" error:&error];
    if (!dirContents) {
        // inspect error
    } 
    

    Use -[NSBundle resourcePath] to get a path to your applications resources directory.

    Understand that your project structure is not equal to the location your resources will end up in your application. Resources are all copied to the Resources directory using your targets
    Copy Bundle Resources buid phase.

    If you really want to add certain files in a different directory in your resources directory add a new Copy Files phase, with a destination of Resources and a Subpath named with your folder, like Images

    Then you can loop over those images using your file manager and the path you get using:

    [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Images"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to get all the images from a facebook group using facebook API
I have created a group folder in my Xcode project named USER_PHOTO Then I
I have 2 images inside a folder called Pics..... Image1.jpg and Image2.jpg. What code
I have a group of H.264 images (I-frames only) that I want to encode
I have a div. Inside the div is another group of divs that each
I have an image that is sliced into 9 images into multiple div. I
I have an images folder with a png in it. I would like to
I have barcode images in jpg format and want to extract barcode # from
We have two images with transparent sections that each have a map and separately
I have 500 images named Image1.tif all the way to Image500.tif and I need

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.