我是 iOS 开发线程的新手,我在这里有问题考虑以下代码
[activityIndicator startAnimating];
[self startAnewOperationInSepThread];
[self startAnotherOperationInSepThread];
我的理解是当第一行执行时,事件指示器将在主线程中启动。所以现在主线程负责运行事件指示器。如何调用后续操作。
最佳答案
使用performSelectorInBackground
[self performSelectorInBackground:@selector(yourmethod:) withObject:nil];
关于iOS在一个线程中运行多个操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16371060/