2

I am doing this iPhone app that works fine on the simulator.
However, when I run it on a device in debug mode, it just crash without any error messages.
How can I debug that?

I heard about a flag we can set to help with this kind of situation but not sure what that flag is and how to set it.
If I'm not mistaken I think what that flag does is put a break point automatically prior to crash.

Thanks,
Tee

teepusink
  • 27,444
  • 37
  • 107
  • 147
  • I found the flag. Check http://stackoverflow.com/questions/1622079/break-on-exc-bad-access-in-xcode. However, that doesn't seem to help. The error I'm getting is "Debugger stopped. Program exited with status value:255.". What does that mean? – teepusink Jan 14 '11 at 08:14
  • Have you set the "stop on Objective-C breakpoint" option in the debugger? Are you getting a stack trace? – JeremyP Jan 14 '11 at 08:54

2 Answers2

0

Are you observing for memory warnings? According to a quick google, those higher valued exit codes are due to an external source (i.e. the operating system) terminating the process. iOS will terminate applications that have ignored memory warnings and not relinquished memory in time.

d11wtq
  • 34,788
  • 19
  • 120
  • 195
0

I once had an issue where I was accessing uninitialized memory (either that or I forgot to null-terminate a C string, some sort of memory access issue) and it worked fine in the simulator because I have a lot more RAM on my computer (and I believe the simulator initialized all of its memory to null on launch, so overrunning memory just returned a null). Long story short, I went through my code and found a place where I was incorrectly handling memory. I fixed that and all was rainbows and butterflies.

Kyle
  • 1,620
  • 14
  • 25