Grand Central Dispatch and unit testing

只愿长相守 提交于 2019-12-04 19:28:47

Ended up doing the following in my tearDown.

while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW)) {
    NSLog(@"...Tearing Down Tests..");
    [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
                             beforeDate:[NSDate dateWithTimeIntervalSinceNow:10]];
}
dispatch_release(semaphore);  

and pushing the semaphore creation into the setUp.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!