iPhone:如何确定线程是否是主线?(复制)

时间:2022-06-01 21:03:09

This question already has an answer here:

这个问题已经有了答案:

How to determine if the current thread inside a method is a main thread, or just a thread that is asynchronous and created? Does the ID tell me?

如何确定方法中的当前线程是主线程,还是异步创建的线程?身份证告诉我了吗?

1 个解决方案

#1


120  

Like this: [NSThread isMainThread]

这样的:[NSThread isMainThread]

#1


120  

Like this: [NSThread isMainThread]

这样的:[NSThread isMainThread]