I have a for loop which is basically calling web service. The response is handled in completion handler
I dont want the execution to come out of this for loop untill unless there is response to all the requests.
below is my code snippet
for(ClassX objectX in myAraay)
{
__block BOOL blockExecutionOver = NO ;
// call web service with completion handeler
callwebservice:^handler
{
// block execution
blockExecutionOver = YES ;
}
];
while (blockExecutionOver == NO)
{
[[NSRunLoop currentRunLoop] run];
}
}
//do something here after above for loop is executed
how do I achieve this.currently this run loop is not serving any purpose for me. I dont have any timeout for these requests. hence i didnt use runtillDate or runMode