Looks good in IB but can't see when I run it.

Discussion in 'iOS Programming' started by detz, Aug 7, 2008.

  1. detz macrumors 65816

    Joined:
    Jun 29, 2007
    #1
    I'm using custom buttons images...it looks fine in Interface Builder but when I run it I don't see it and get this message.

    Could not load the "buttonup.png" image referenced from a nib in the bundle with identifier "com.yourcompany.Test"
     
  2. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #2
    Did you import (drag) that file into your project in xcode? Also I believe the file names are case sensitive, so are you sure it is names "buttonup.png" and not "buttonUp.png" or something?
     
  3. detz thread starter macrumors 65816

    Joined:
    Jun 29, 2007
    #3
    Yes, images in there and in the directory. Button name is correct.

    Nevermind, it seems something was wrong with the image even though I could see it. I replaced it and it works.
     
  4. bagvoo macrumors newbie

    Joined:
    Aug 22, 2008
    #4
    if you have created a custom button type in interface builder and assigned a image to that button, IB automatically assigns that image to all the button states Default, Hightlighted, Selected and Disabled...

    So if you happen to delete that image from the project, IB will think it has gone missing from each of those states, in order to get rid of the warning one needs to re-assign the correct image for each state for which it was assigned (not just the default one you thought you assigned it to).

    -Ben
     
  5. jimerman macrumors newbie

    Joined:
    Feb 10, 2010
    #5
    Same problem, what was wrong?

    I'm having the same problem. I edited 2 images in Gimp, saved them as PNG, added them to the project. They show up fine in IB, but when I build and run in the simulator I get the error message in the console.

    As far as I can tell, there is nothing wrong with the image files. I noticed they were too big, so I scaled & saved them, perhaps that caused XCode/IB to choke on it? But, I deleted them from the project and re-added them. They show up just fine in the Media section of the IB Library.

    Hopefully someone will have a suggestion?
     
  6. jimerman macrumors newbie

    Joined:
    Feb 10, 2010
    #6
    Solved it!

    My problem was, in a new project I had not updated the info.plist Bundle Identifier, has to match com.<yourcompany>.${PRODUCT_NAME:<xxxxx>}

    Once I updated yourcompany, it worked fine.
     
  7. fernandovalente macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #7
    Go Xcode > Empty Caches
    Then Build > Clean All Targets

    Let me know if it works
     
  8. MiniMacLean macrumors newbie

    Joined:
    Mar 9, 2008
    #8
    yeh i got the problem to :/

    and..

    no that doesnt work

    EDIT: werid just tried to open the file with photoshop and it couldn't:
    [​IMG]
    weird photoshop bug.. :/ so maybe 'clean all targets' might work for some
     
  9. fernandovalente macrumors 6502

    fernandovalente

    Joined:
    Aug 29, 2008
    Location:
    Third world **** hole, I mean, Brazil
    #9

    The image file may be corrupted. Try opening it with another app like Preview and re-save it.
     
  10. kennywyland macrumors newbie

    Joined:
    May 6, 2010
    #10
    We just ran into the same problem while converting our app to iPad and discovered the error.

    The images aren't associated with the new iPad target. We shift-selected all of the images in XCode, hit Cmd-i to bring up Info, chose the Targets tab and checked the box for our new iPad target and viola.
     
  11. TRS80Grad macrumors newbie

    Joined:
    Jan 11, 2010
    Location:
    Michigan
    #11
    Looks good in IB but can't see when I run it.

    Same problem: Error message during load into Simulator is: Could not load the "imageNamed:NSStopProgressFreeStandingTemplate" image referenced from a nib in the bundle with identifier "com.GRSEnterprisesNLC.Frrraction".
    The problem image is provided by the system; my spelling and capitalization are correct; it shows up on the view in Interface Builder so the reference is correct. Clean before Build does not help. The company reference, com.GRSEnterprisesNLC, as well as the app name mentioned in the error msg are correct.
     
  12. rupeshmenon macrumors newbie

    Joined:
    Dec 20, 2010
    Location:
    Vaikom,Kerala,India
    #12
    Issue with image

    Hi,

    The problem is with the image that you are using.
    Change the image to PNG-24 format and then try.
    It worked for me.
    Hope will solve your problem.

    Regards,
    Rupesh R Menon
     
  13. TRS80Grad macrumors newbie

    Joined:
    Jan 11, 2010
    Location:
    Michigan
    #13
    Unintended image reference in nib

    Thank you! I kept getting the error msg "Could not load the "imageNamed:NSStopProgressFreeStandingTemplate" image referenced from a nib..." I don't know why that system image fails, but I replaced it with a substitute. The error wouldn't go away, and I could not find how to delete the image nor nib references to it. After reading your post I went back to IB, checked those other button states, and voila! There were the guilty references. I corrected the residual unintended references to that image. Problem solved.
     

Share This Page