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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:10:29+00:00 2026-06-13T16:10:29+00:00

On iOS 6 this block of code works fine: – (NSString*)cLocalImageName { [self willAccessValueForKey:@cLocalImageName];

  • 0

On iOS 6 this block of code works fine:

- (NSString*)cLocalImageName
{
     [self willAccessValueForKey:@"cLocalImageName"];
     NSString*pathToImage;
     if ([self.cIsUserCreated boolValue]) {
         pathToImage =  [self primitiveValueForKey:@"cLocalImageName"];
     }else{
         pathToImage = [[NSBundle mainBundle] pathForResource:[self primitiveValueForKey:@"cLocalImageName"] ofType:@".png"];
     }
     [self didAccessValueForKey:@"cLocalImageName"];
     return pathToImage;
}

Namely this line always returns the correct file path:

 pathToImage = [[NSBundle mainBundle] pathForResource:[self primitiveValueForKey:@"cLocalImageName"] ofType:@".png"];

However, on iOS 5 that line always returns nil, and I instead have to call:

 pathToImage = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",[self primitiveValueForKey:@"cLocalImageName"]]];

Can anyone give me any insight into why this is an issue on iOS 5?

Things I’ve ruled out:

• [self primitiveValueForKey:@”cLocalImageName”] is not returning nil.

• The .png objects are in fact present in the compiled .app package once the app is built.

  • 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-13T16:10:30+00:00Added an answer on June 13, 2026 at 4:10 pm

    Shouldn’t this line:

    pathToImage = [[NSBundle mainBundle] pathForResource:[self primitiveValueForKey:@"cLocalImageName"] ofType:@".png"];
    

    be this:

    pathToImage = [[NSBundle mainBundle] pathForResource:[self primitiveValueForKey:@"cLocalImageName"] ofType:@"png"];
    

    ?

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

Sidebar

Related Questions

I have the following block of code which works fine in the simulator and
I wrote this code in my viewDidLoad function in my iOS project. lettersLeftLabel.text =
This works on the iPhone BTW (Both running iOS 5.1) My app freezes when
Possible Duplicate: Why is glReadPixels() failing in this code in iOS 6.0? I currently
In this block of code: NSArray *supportedOrientations = nil; if( iPhone ) { //
Have a (rather complex) app that works fine on iOS 4 but fails on
I'm a newbie at iOS development and this is my first question on SO.
yes this is an iOS programming question. I need to calculate the exact time
Does this work in > iOS 5? .element { background: url(images/myImage.jpg) 50% 0 no-repeat
This is an iOS question. I build a static library (a framework in iOS)

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.