如何在其他线程中打印主线程的回溯?而在其他线程,我想打印的主要thread.is的回溯有任何sanple代码给我?
pcrecxhr1#
执行以下操作:
dispatch_async(dispatch_get_main_queue(), ^{ NSLog(@"Trace = %@", [NSThread callStackSymbols]); });
py49o6xq2#
查看代码(GPL v3):BSBacktraceLogger
+ (NSString *)bs_backtraceOfCurrentThread { return [self bs_backtraceOfNSThread:[NSThread currentThread]]; } + (NSString *)bs_backtraceOfMainThread { return [self bs_backtraceOfNSThread:[NSThread mainThread]]; }
2条答案
按热度按时间pcrecxhr1#
执行以下操作:
py49o6xq2#
查看代码(GPL v3):BSBacktraceLogger