Ale*_*ove 120 iphone cocoa multithreading objective-c
有没有办法打印出当前正在执行当前方法的线程ID?
(Objective-c please)
nal*_*all 220
NSLog(@"%@", [NSThread currentThread]);
Run Code Online (Sandbox Code Playgroud)
neo*_*eye 33
#include <pthread.h>
...
mach_port_t machTID = pthread_mach_thread_np(pthread_self());
NSLog(@"current thread: %x", machTID);
Run Code Online (Sandbox Code Playgroud)
dim*_*mdy 23
在Swift3中
print("Current thread \(Thread.current)")
Run Code Online (Sandbox Code Playgroud)
Gla*_*ves 11
在斯威夫特
print("Current thread \(NSThread.currentThread())")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
52993 次 |
| 最近记录: |