ios - Execute dispatch_async(dispatch_get_main_queue() from xctest -
i trying write test, stubs requests ohhttpstubs , should load ui. stub part working, problem is, test , ui loading both executed on main thread, block of loading viewcontroller never gets executed. tips in advance. have great day.
dispatch_block_t mainblock = ^{ wdsomevc *viewcontroller = [[wdsomevc alloc] initwithdata:data andstyle:self.style]; viewcontroller.delegate = self; [self switchrootcontroller:viewcontroller withcompletion:nil]; }; dispatch_async(dispatch_get_main_queue(), mainblock);
i solved using code.
[[nsrunloop mainrunloop] rununtildate:[nsdate datewithtimeintervalsincenow:timetowait]];
Comments
Post a Comment