我有这样的代码:
[self performSelectorInBackground:@selector(indicator) withObject:nil];
[self mail]; //opening my controller of e-mail sending
- (void)indicator
{
[actView startAnimating];
}
这工作正常,但我担心线程安全。我没有在第二个线程中分配内存,但是有一个告诉我这太简单了:)
最佳答案
无论如何,startAnimating
会立即返回,因此您在后台调用它并不会获得任何好处。
关于iphone - 使用performSelectorInBackground运行加载指示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1965714/