Ah! Just as I sent that email I realized what it is. It's a unit test, so 
there's no run loop. So the async block never gets called (the main code path 
returns before it gets a chance).

So, my real question is: how do I unit test dispatch_async()? Time to Google…

---------


I have some code that calls dispatch_async(). It's called on the main thread 
and dispatches to the main thread. The dispatch happens and the calling code 
returns, but the block is never called.

Is there any condition that might cause that to be the case?

This is happening in a unit test target in a Cocoa app.

-- 
Rick




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to