Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

counciler

macrumors newbie
Original poster
Jan 8, 2011
25
0
I created a basic timer/random number generator app. I have a tick for the timer and a noise when the number is generated. I'm currently using AVAudioPlayer for it, though I'm planning on switching to OpenAL once I learn it. Now, twice so far, when I start playing the timer or random number, the app instantly shows the Apple logo, as if it's been restarted. It happens very quickly, normally the phone takes a few seconds just to shut down. I've used the app on the go and it wasn't attached to a debugger during the times it's happened, it's not consistent. Though I don't know if a debugger could help me here, these things are supposed to be sandboxed and not doing things like restarting my phone. I have the creeping suspicion it has to do with the sound since AVAudioPlayer has only given me problems since I started using it.
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
Use to Analyzer to check your code. In Xcode 4 that is Analyze under the Product menu. Once you fix identified issues here, try running it again.

The next step would be to Profile the executing app. You choose Profile under the Product menu. That runs Instruments. The common choices to use from the panel that first pops up is to use Leaks. There are several tools in it you could use.

If you do crash when connected to Xcode, you want to figure out where it is crashing. Setting a break point at that line will stop the code at that line before it executes allowing you to investigate parameters for the line. Many people use NSLog() to zero in on issues.

Oh, your app writes to a log when it crashes. You maybe be able to get that and review where the crash was. I'm still learning about the details for this.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.