iOS – performSelectorOnMainThread with Multiple Objects
Posted by John Wordsworth on August 08, 2011 in iOS Development tagged with Cocoa, iOS, NSInvocation, performSelectorOnMainThreadI recently ran into the situation where I wanted to call NSObject's performSelectorOnMainThread with multiple arguments. While it wasn't massively difficult, it was a bit more fiddly than I first expected - you have to get your hands dirty with NSInvocation. I've built a category that adds an additional method to NSObject which will allow you to call a performSelectorOnMainThread method with any number of objects as parameters. Feel free to use it in your own projects!
Continue ReadingView Comments (4)
