|
[Objective-C] How to debug EXC CRASH (SIGTRAP) |
|
 |
//
// First method :
//
// In XCode 4 click your project and choose the breakpoints tab.
// At the bottom of that tab is +/- search bar, choose the + item and "Add Exeception Breakpoint".
// You can leave it at All or choose Objective-C.
// This way you will break in the debugger and be able to see what caused the exeception.
//
// Second method:
//
#ifdef DEBUG
void eHandler(NSException *);
void eHandler(NSException *exception) {
NSLog(@"%@", exception);
NSLog(@"%@", [exception callStackSymbols]);
}
#endif
int main(int argc, char *argv[]) {
#ifdef DEBUG
NSSetUncaughtExceptionHandler(&eHandler);
#endif
// ...rest of your main function here...
}
|
|
|
|
|
|
|
|
Copyright © 1996-2022 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581. |
|
|
|