This methon is really cool:
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait;
But I need something simple like it to perform method with number of arguments in main thread like:
- (void)methodWithFirstObject: secondObject:
What is the simplest way to do this?
performSelectorOnMainThreadis just a convenient way of playing with anNSOperationwhich is a convenient way of playing with GDC. If you ever need more functionality, just drop down to the next level. You’ll have to manage a bit more complexity, but will have more flexibility. An awful lot of cocoa is designed this way.You’ll want to read up on
NSOperation, but I think this will do what you want [typing on my phone, haven’t compiled]