Works in the simulator, but not on my device...
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.
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.
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.
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.
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.
Interesting. Is the iPhone formatted as UFS? I figured it would be HFS+ like most Mac OS X installs.
It does say in the guide at the very bottom of the file and data management section:
Very easy to miss that little tidbit...
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...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| How Does this game works?? | jeroenx000 | 10 | 7,301 |
May 6, 2012 06:36 PM Last Post: jeroenx000 |
|
| new engine in works. advice? | godexsoft | 4 | 3,799 |
Apr 7, 2012 07:25 AM Last Post: godexsoft |
|
| Getting app store to show the game now works with 3.0? | Madrayken | 4 | 3,926 |
Jan 25, 2010 12:20 PM Last Post: Madrayken |
|
| Touches: Device vs Simulator | vectorscope | 4 | 3,717 |
Sep 22, 2009 03:25 PM Last Post: Skorche |
|
| Anyone know how the new releases list works? | kendric | 3 | 3,253 |
Aug 30, 2009 09:23 AM Last Post: kendric |
|

