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

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -