A typical call to performSelectorOnMainThread:
looks like this:
[target performSelectorOnMainThread:action withObject:foo waitUntilDone:NO];
In response to a similar question on passing non-objects to a method in performSelectorOnMainThread:
, I pointed out Dave Dribin's category on NSObject, which lets you do something like the following:
[[person dd_invokeOnMainThread] doSomethingWithThing1:thing1 andThing2:thing2 andAlsoThing3:thing3];
for performing your multi-argument method on the main thread. I think this is a pretty elegant solution. Behind the scenes, he wraps things in an NSInvocation, invoking that on the main thread.
The Amber framework does something similar to this, as well.