Adding icon to iPhone App

Discussion in 'iOS Programming' started by satyam90, Jul 8, 2009.

  1. satyam90 macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    I created application for iPhone successfully and now looking for distribution of it to App Store.
    For that I have created 57x57 pixels myapp.png image which is of size 7kb.
    From XCode, I added this file to project with option "copy". Now I am able to see the icon under "Resources" folder.
    In Info.plist file, a new entry was created "Icon file" and the value I set is "myapp"

    In Simulator I am able to see the icon. But executable in "build" directory is not having the icon.

    I am not knowing how to set the icon for executable.

    Please help me.
     
  2. CylonGlitch macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #2
    I just looked in my build directory and didn't see the icon either. But I know that when I install the application on the iPhone it is there. I think it is embedded you just don't see it with the OSX Browser.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    Are you viewing the package contents of your .app file?
     
  4. CylonGlitch macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #4
    Yeah, I opened up the package and there is an icon.png file (what I called mine, lame, I know) and when I open that in preview all I get is a ? image. Same thing if I look at the default.png. So I figured it is doing something funky with the code; are they encrypted with the developer information?
     
  5. danimal99 macrumors regular

    Joined:
    Jul 21, 2008
    #5
    Did you set the icon in the target properties? (Get Info -> Properties)
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    I can view my images from the package contents in Preview just fine.
     
  7. CylonGlitch macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #7
    /shrug

    Donno... :D
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    png images inside the app bundle targeted to the device are modified in a way that reduces their size. It's not an encryption per se but they are not standard png files after that and Preview and Photoshop can't display them. This apparently doesn't affect png images for the Sim and doesn't affect jpegs or other image formats.

    OP, delete your build folder and try again. Xcode doesn't always add new versions of image files to an app when it should.
     
  9. CylonGlitch macrumors 68030

    CylonGlitch

    Joined:
    Jul 7, 2009
    Location:
    SoCal
    #9

    Well there you have it, thanks!
     
  10. satyam90 thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #10
    I tried deleting build folder. And built it again. Still I am not able to see the icon for my .app
     
  11. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #11
    Also, double check that the name of the file is correct, including case. Myapp.png != myapp.png
     

Share This Page