I´m using this in a try - catch structure to get informed in which method the exception was thrown:
NSLog(@"%@", NSStringFromSelector(_cmd));
I wonder if there is a way in Xcode 4 also to get the line number where the error occurred.
Any hints?
I´m using this in a try - catch structure to get informed in which method the exception was thrown:
NSLog(@"%@", NSStringFromSelector(_cmd));
I wonder if there is a way in Xcode 4 also to get the line number where the error occurred.
Any hints?
There’s a __LINE__
macro that you might find useful, see this previous question for an inspiration.
Try this in the @catch
clause:
NSLog(@"Stacktrace: %@", [NSThread callStackSymbols]);
During development you can set a symbolic breakpoint on objc_exception_throw
and see where the error occurs in the Xcode debugger.
You can add an exception break point in the Break Point Navigator menu in the left side of Xcode and this will stop you at the position when the exception happened