views:

426

answers:

3

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:)

+1  A: 

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

Morion
+1  A: 

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

David Maymudes
A: 

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