Objective C - Unit testing dispatch_async block?

前端 未结 3 1937
北荒
北荒 2020-12-29 08:28

I read other posts that come up with solutions to this question. However, their solutions require hacky code to be added to my application in order to be able to test it. To

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 08:43

    Wrap the execution into a dispatch_group and then wait for the group to finish executing all dispatched blocks via dispatch_group_wait().

提交回复
热议问题