Images don't appear in iPhone but appear in iPhone simulator

Discussion in 'iOS Programming' started by a.periz, Jul 17, 2009.

  1. a.periz macrumors newbie

    Joined:
    Jul 17, 2009
    #1
    Hi,
    i'm developing an app with custom UISlider, so i created some png images, add them into the project and i follow the UICatalog method to create the sliders.
    When I install this app in the iPhone simulator, it works very well, but, when i put it into the iPhone, the sliders don't appear...
    I tried to load the same image i use for the slider in a UIImageView and add it into the main view (self.view) and it doesn't appear yet...
    Somebody can help me?
    Thanks so much!

    Andrea
    (sorry for my english)
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    How did you add the images to your project? Did you copy them or just link them? If you just linked them, that's why they work in the simulator but not on the device.
     
  3. a.periz thread starter macrumors newbie

    Joined:
    Jul 17, 2009
    #3
    Yes, i copy the images in the project and i also checked (through ssh) that the images are into the .app forlder in the iPhone...
     
  4. P2k macrumors newbie

    Joined:
    Jul 17, 2009
    #4
    I once had the same problem. In my case I had a UITableView with some transparent images as cell icons. The non transparent pngs were displayed in the simulator as well as on the device, the transparent not. So I removed transparency and it worked.
     
  5. a.periz thread starter macrumors newbie

    Joined:
    Jul 17, 2009
    #5
    I split the initialization:
    Code:
    		UIImage * aux = [UIImage imageNamed:@"redSliderDefault.png"];
            UIImage *stetchLeftTrack = [aux stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
    		NSLog(@"Aux = %@; stetchLeftTrack = %@", aux, stetchLeftTrack);
    and they are both nil!
    do you know why?

    Thanks
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    The usual explanation is that the case of the file names varies between the real file name and the name you're trying to load. The Sim file system is case-insensitive and the phone file system is case-sensitive.
     
  7. a.periz thread starter macrumors newbie

    Joined:
    Jul 17, 2009
    #7
    I found the problem!
    The pngs MUST have a 150 dpi resolution..
    this works for me...
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    Hmm, must be something else really. There is no such restriction on images.
     
  9. pravara15 macrumors newbie

    Joined:
    May 14, 2009
    #9
    in my application, the images are not present in .app folder.:confused:
    Can anyone please, tell me the way, to add images in the .app folder.
    (The folder created for distribution in ad-hoc mode):)
     
  10. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #10
    check to make sure the .PNGs were saved in an RGB space (not grayscale, etc.). i've had issues with images that were saved with a grayscale space turning out crazy / not appearing on the device.
     

Share This Page