Luckily, NSObject implements just such a function, which is called performSelectorOnMainThread, that lets you call the selector of an object in the main thread's context:
[myView performSelectorOnMainThread: @selector(update:) withObject: updateItems waitUntilDone: YES];
It even has the option to let the calling thread wait until the call has been completed!
No comments:
Post a Comment