4

So I have a rather complex application that I've, perhaps naively, agreed to "debug". Upon entering into a certain method, I'd like to print out as much info about who called the method, from which class, method, etc. it was called from. Any suggestions would be very much appreciated!!

ennuikiller
  • 46,381
  • 14
  • 112
  • 137

2 Answers2

3

Just add in your method:

NSLog(@"Show stack trace: %@", [NSThread callStackSymbols]);
Dmitry A.
  • 588
  • 8
  • 13
1

For debugging you could use a debugger :) put a breakpoint in the method and view the backtrace.

You could also scatter NSLog statements with relevant information in methods.

Ciarán Walsh
  • 1,866
  • 14
  • 11