So I have a rather complex application that I've, perhaps naively, agreed to开发者_StackOverflow中文版 "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!!
Just add in your method:
NSLog(@"Show stack trace: %@", [NSThread callStackSymbols]);
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.
精彩评论