I got a separate thread that creates a UIView object, inserts it into the UITableView's data source and then call reloadData on the UITableView. However, since it is a separate thread, it cannot call reloadData directly, it needs to make the mainthread do it... but how do you tell the mainthread to do it?
Thanks
[self.tableView performSelectorOnMainThread:@selector(reloadData)
withObject:nil
waitUntilDone:NO];
You can use dispatch async, this method allows you to marshal worker thread to blocks of in-line code rather than methods using performSelectorOnMainThread:
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableview reloadData];
});'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With