Works in the simulator, but not on my device...

Apprentice
Posts: 12
Joined: 2008.11
Post: #1
Hi all!

First time here, so please be gentle...

I have modified the bouncing ball tutorial posted on iCodeBlog.com. Basically, I have altered it so the ball imageView is created programatically (via a new "Ball" class). This works great in the simulator (I even worked out how to pick it up and move it around!), but it just refuses to display the ball on the phone. The original tutorial worked fine (ie, with the ball defined within UI Builder).

Does anyone know why this might be?

The code which creates an instance of my ball is as follows (and sticking a trace in there confirms that it does run through this method...):
- (void)setUpBall {
//Create an instance of the ball...
Ball *aBall = [[Ball alloc] init];
self.ball = aBall;
[aBall release];
ball.center = self.view.center;
[self.view addSubview:ball];
}

Any help appreciated!!

Cheers,

D.
Quote this message in a reply
Apprentice
Posts: 12
Joined: 2008.11
Post: #2
Sorted it!!

It seems the Simulator doesn't care if you get the case wrong in when referencing image file names... (ie, "Ball.png" should have been "ball.png"), whereas the device does!!

Cheers,

D.
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #3
Thanks for letting us know about that. It serves as a good reminder about case-sensitivity. Those bugs can be a pain to track down sometimes.
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #4
Interesting. Is the iPhone formatted as UFS? I figured it would be HFS+ like most Mac OS X installs.
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #5
It does say in the guide at the very bottom of the file and data management section:

Quote:The file system for iPhone OS–based devices is case sensitive. Whenever you work with filenames, you should be sure that the case matches exactly or your code may be unable to open or access the file.

Very easy to miss that little tidbit...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How Does this game works?? jeroenx000 10 8,637 May 6, 2012 06:36 PM
Last Post: jeroenx000
  new engine in works. advice? godexsoft 4 4,468 Apr 7, 2012 07:25 AM
Last Post: godexsoft
  Getting app store to show the game now works with 3.0? Madrayken 4 4,372 Jan 25, 2010 12:20 PM
Last Post: Madrayken
  Touches: Device vs Simulator vectorscope 4 4,412 Sep 22, 2009 03:25 PM
Last Post: Skorche
  Anyone know how the new releases list works? kendric 3 3,596 Aug 30, 2009 09:23 AM
Last Post: kendric