I have a feeling I’ll be posting a bunch of these quick posts, so this is part #1.

A few days ago, I was working on finishing version 2.0 of Binary Game [iTunes Link] when I ran into an interesting and annoying problem.

For the high scores view in the app, I was programatically creating a UIButton then setting a Background image to it, like so:

[myButton setBackgroundImage:[UIImage imageNamed:@"highscores-Button.png"] forState:UIControlStateNormal];

Running the app in the simulator worked perfectly. However, the button was missing it’s background image every time I tested on the device. I assumed that maybe some pre compiled code was not being rebuilt, so I Cleaned All Targets and rebuilt.. Still no go. Eventually, after much confusion and frustration I figured out the problem, which ended up being a careless mistake on my part.

The image name I was setting to the background was “highscores-Button.png” when I had actually named the image “highscores-button.png”.

It seem that the simulator doesn’t care about case sensitivity when setting imageNamed, so there were no warnings thrown at me. The device does care about case sensitivity in file names, but again, I didn’t notice any warnings, instead it just never loaded the background image.

So, if you run into anything like this, double check the capitalization of your files!