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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:34:05+00:00 2026-06-10T20:34:05+00:00

I just spent a day trying to figure out why some simple code was

  • 0

I just spent a day trying to figure out why some simple code was not loading images from the resources folder. Just for kicks I went into the finder and renamed one of the files to exactly the same name and it loaded. Then I did the others – simply renaming them to the same name. I looked and there weren’t any strange characters or whitespace before or after the file name. So now they all load fine into an array in the simulator. But now on my device, they aren’t loaded into the array, returning “nil” and are throwing exceptions. I know that ios devices are case sensitive where the sim is not but I checked this and the naming is all fine. The only thing I can think of is that my images are named for retina (@2x~iphone) and my device is not. But I have images named the same way, for retina, and those load fine.

I am using imageWithContentsOfFile to load the images and also getting a memory warning after it tries to load the images. I am not sure if the memory warning is related.

  • 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-10T20:34:06+00:00Added an answer on June 10, 2026 at 8:34 pm

    I think the problem might be in your file naming. Remember that you should include both retina and non-retina graphics in your app. Seeing as you added “~iphone” I’m assuming this is a universal application so your images should be named as follows:

    1. myImage~iphone.png
    2. myImage@2x~iphone.png
    3. myImage~ipad.png
    4. myImage@2x~ipad.png

    Then in your code you only reference the “myImage” part of the file name so iOS can sort the rest out for you.

    For example:

    UIImage *image = [UIImage imageNamed:@"myImage"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just spent too much time of my day trying to figure out some
I've spent half day trying to figure out this and finally I got working
I've spent the day trying to figure out a strange problem. I have a
I just spent the last 3 hours trying to figure out this error. I
I have spent a good day trying to figure out why the PasswordBox is
I have spent the better part of today trying to figure this out and
I've spent over half a day on this - just trying to get the
I just spent way too long trying to diagnose why, in the following snippet
I've spent the past two days just trying to enable the sending of email
I just got this site sent to me because a page is not loading,

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.