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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:28:10+00:00 2026-05-23T03:28:10+00:00

I created a directory MyDirectory inside a bundle myBundle. I then put an image

  • 0

I created a directory MyDirectory inside a bundle myBundle. I then put an image myImage.png inside MyDirectory. But a call to

 [myBundle pathForResource: @"myImage" ofType: @"png"] 

does not find the image. What am I missing?

EDIT: To clarify, if the image is in the top level of the bundle, it finds it just fine.

  • 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-23T03:28:11+00:00Added an answer on May 23, 2026 at 3:28 am

    First you must have added the image to the bundle. If you’ve did it, I guess you would have added folder references while you added the image to the project. If so, you should specify the folder hierarchy with the image name.

    [myBundle pathForResource:@"MyDirectory/myImage" ofType:@"png"];
    

    Edit: As Deepak commented below, there is even a better method pathForResource:ofType:inDirectory:

    [myBundle pathForResource:@"myImage" ofType:@"png" inDirectory:@"MyDirectory"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a server. I've created my own directory but need
I created a virtual directory for my php app. Now I get the Directory
I have a directory of ZIP files (created on a Windows machine). I can
I created a script that list the directories in the current directory <?php $dir
I had created a zip file (together with directory) under Windows as follow (Code
I have created a web service in a virtual directory using VS 2008. I
I have created a script that saves some files in the Documents directory of
//on some hosts the uploads directory is not automatically created //on WP auto install
I have created a concurrent, recursive directory traversal and file processing program, which sometimes
So I have a django project I just created called 'coolprojectsite' the directory structure

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.