views:

729

answers:

3

So I'm developing and iPhone game right now and everything has been working just fine when I test it on my first gen iPod touch. Last night, I added in some NSUserDefaults stuff to save a few variables for it. I ran it on the simulator a few times and it worked perfectly, but when I built the app and put it on my iPod, all I got when I launched it was a black screen. Anyone have any ideas? They would be much appreciated, thank you.

A: 

Do you have a custom Default.png file? If no, then you will see a black screen while your application loads. Depending what type of (possibly unending) operations you are doing on load this might be the reason you are seeing a black screen. Remember the simulator runs on top of the processor in your mac which is significantly faster than the processor in your iPod Touch.

zPesk
I've tried to let the program run for a few minutes to no avail
+2  A: 

I recommend deleting the application from your iPod Touch first then trying to install it again. When are you trying to read from NSUserDefaults? In your applicationWillFinishLaunching call? If so, try to comment that out to ensure that it really is the source of your problem.

Reed Olsen
is anything printed in the debug console in XCode?
Ben Gotow
I'm calling it a little later in the application, which is why I'm confused as to the problem. The console acts fine when I'm running it. And the version I used before the one with NSUserDefaults runs quickly, it wasn't a large change.
+1  A: 

You need to run it on the iPod touch with the debugger switched on - you should be able to track this down.

Do you know about setting a breakpoint for exceptions - if you tell the debugger to break on objc_exception_throw it is extreemly useful in these cases.

Grouchal
Debugger/iPhone console helped loads, thanks