1

I have such a code:

[self performSelectorInBackground:@selector(indicator) withObject:nil];
[self mail]; //opening my controller of e-mail sending
- (void)indicator 
{
   [actView startAnimating];
}

This works fine, but i'm afraid of thread safety. I'm not allocating memory in a second thread, but smth tell's me that's too simple:)

max
  • 11
  • 2

3 Answers3

2

startAnimating will return immediately anyway, so you don't gain anything by calling it in the background.

David Maymudes
  • 5,664
  • 31
  • 34
1

you should not use this method. any UI changes from background threads will cause memory leaks.

Morion
  • 10,495
  • 1
  • 24
  • 33
0

No, it doesn't. It's working until the controller won't be pushed. I've added an autorelease pool to my function, for sure.

max
  • 1
  • 1