At first glance it seemed like an easy question, but I just can’t figure how to run an anonymous block on a certain background thread i.e. I am looking for the blocks equivalent of -performSelector:onThread:withObject:waitUntilDone:.
Related: Is it possible to associate a dispatch queue with a certain background thread, just like the main queue is associated with the application’s main thread?
Edit Clarified that I am looking to run an anonymous block
I saw this function
RunOnThread()recently in Mike Ash’s PLBlocksPlayground (zip file, see BlocksAdditions.m):This is what I was looking for.
There are a bunch of other very useful blocks related utilities in PLBlocksPlayground, most of which Mr. Ash explains in this post.