In my app, each cell in the UITableview needs data acquired from an API. To make the app look faster, I am acquiring data for one cell at a time and displaying it by using [tableview reloadData]
. But while doing this, the ViewController itself is unresponsive. I cannot hit the back button or the tap a cell(to call didSelectRowAtIndexPath
). Is there a solution for this?
I am calling the reloadData
method like this
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
dispatch_async(queue, ^{
[tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
});