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
相關文章
相關標籤/搜索