Images loading in simulator but not on device

Apprentice
Posts: 10
Joined: 2008.12
Post: #1
I've got a whacky problem.

I'm loading 5 images with
Code:
CGImageRef image = [UIImage imageNamed:string].CGImage;

Now, in the simulator all 5 images are loading fine. However, on the device only one of them is being loaded and for the rest, nil is returned. It doesn't matter what order i load these images in it's always the same ones which return nil and the same one which works. The images are practically the same; same dimensions, same colour space, same number of alpha channels.

I've even tried making a copy of the image that works and loading this in but with no success.

Also, all the images have been copied to resources and I have set the current working directory to the resource bundle.

Any ideas on what's happening here? I'm not getting any error messages printed in the the debug console Huh

Any help at all would be fantastic.

Cheers,

Chris.
Quote this message in a reply
Apprentice
Posts: 10
Joined: 2008.12
Post: #2
Ok never mind that, problem solved!

For future reference of any readers... case of filenames/paths does not matter when building a 'simulator' target but it does when building a device target. Silly mistake I know but strange nonetheless in the differences between device and 'simulator'.
Quote this message in a reply
Member
Posts: 178
Joined: 2008.09
Post: #3
thanks for the info

my iphone website: http://www.elsalvadorguia.com
intel Imac 20", iphone 8GB (2G)
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #4
fretmunky Wrote:For future reference of any readers... case of filenames/paths does not matter when building a 'simulator' target but it does when building a device target. Silly mistake I know but strange nonetheless in the differences between device and 'simulator'.

More accurately, the iPhone uses a case-sensitive filesystem, which is a (non-default) option for the Mac, too. For this reason, if you're developing on a case insensitive system and your file names don't match up, your application may not run on everyone's system. So, it's important to always, always, always write file names with the exact same case in your code as on the filesystem.
Quote this message in a reply
Apprentice
Posts: 10
Joined: 2008.12
Post: #5
Quote:More accurately, the iPhone uses a case-sensitive filesystem, which is a (non-default) option for the Mac, too. For this reason, if you're developing on a case insensitive system and your file names don't match up, your application may not run on everyone's system. So, it's important to always, always, always write file names with the exact same case in your code as on the filesystem.


Indeed, as I said it was a silly mistake on my part. A typo that cost me hours of time scratching my head LOL
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Touches: Device vs Simulator vectorscope 4 4,342 Sep 22, 2009 03:25 PM
Last Post: Skorche
  touches stopped working on device, works in simulator aerospaceman 4 4,488 Jul 29, 2009 05:06 PM
Last Post: aerospaceman
  Compiling For Device Yields Errors; Simulator Compiles Fine Nick 3 3,490 Dec 23, 2008 12:27 PM
Last Post: Nick
  Works in the simulator, but not on my device... duncster 4 3,751 Nov 19, 2008 03:24 PM
Last Post: AnotherJake