tags:

views:

104

answers:

2

What is the difference between

performSelectorOnMainThread

performSelectorInBackground

performSelector

Thanks

A: 

The thread on which the selectors will be performed... ?!

Johan Kool
You are supposed to answer questions, not ask them :P
willcodejavaforfood
@willcodejavaforfood :-) I guess I was a bit too cynical when I "answered"...
Johan Kool
+1  A: 

performSelector will simply do what it says, usually you would use this when you want to execute a selector using it's name as an NSString, this is useful in situations where you programatically build the name of a selector. If you are familiar with Java you could loosely compare it with reflection.

performSelectorInBackground will execute the selector asynchronously in a new thread in the background so that you can send off long tasks without locking up your UI

performSelectorOnMainThread will simply perform the selector on your applications main thread as it states. This has the potential of freezing the ui, you might reserve it to do tasks that update the ui explicitly

Flash84x