【问题标题】:Does makeObjectsPerformSelector: always happen on the main thread?makeObjectsPerformSelector: 总是发生在主线程上吗?
【发布时间】:2017-08-14 06:51:33
【问题描述】:

我有一行代码使用makeObjectsPerformSelector:

[view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]

在我的项目中。这是否总是发生在主线程上?

【问题讨论】:

    标签: ios multithreading cocoa-touch nsarray


    【解决方案1】:

    不一定。方法将在调用它们的线程上运行,除非它们的文档另有说明。比较performSelectorOnMainThread:withObject:waitUntilDone:performSelector:onThread:withObject:waitUntilDone:modes:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-22
      • 1970-01-01
      • 1970-01-01
      • 2015-02-03
      • 1970-01-01
      • 1970-01-01
      • 2017-01-26
      • 2016-02-09
      相关资源
      最近更新 更多