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!!
A:
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
2009-12-28 17:00:07
+3
A:
Have a look at this blog post about getting the stack trace. Think you should be able to distill what you need from it.
epatel
2009-12-28 17:16:13
very nice! thanks!
ennuikiller
2009-12-28 17:23:36
Hey, I recognize that site!
Tom
2009-12-30 06:06:43
+1
A:
I answered a similar question; different only in that the other questioner was trying to log the caller from within code.
You might find it interesting:
http://stackoverflow.com/questions/1793999/how-to-find-out-who-called-a-method/1794051#1794051
bbum
2009-12-28 18:03:43