Images loading in simulator but not on device
I've got a whacky problem.
I'm loading 5 images with
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
Any help at all would be fantastic.
Cheers,
Chris.
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

Any help at all would be fantastic.
Cheers,
Chris.
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'.
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'.
thanks for the info
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: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

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