As Mike Ash points out, you just can't call waitUntilExitrandom runloop. It is convenient, but it does not work. You must include “not working” when calculating “is it really convenient?”
terminationHandler 10.7+. runloop, . waitUntilExit - (, , ):
dispatch_group group = dispatch_group_create();
dispatch_group_enter(group);
task.terminationHandler = ^{ dispatch_group_leave(group); };
[task launch];
dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
dispatch_release(group);