How to NSLog a Call stack when a program is running?

Of course there is. If you can use the Cocoa framework: NSLog(@"%@", [NSThread callStackSymbols]); (Documentation.) If you can't use it: #include <execinfo.h> int size = 256; void *stack[size]; s
相关文章
相关标签/搜索