I have a tableView
and need to perform a function once the tableView
has been reloaded. How do I know if reloadData
has finished? Lets
The problem is that you call reloadData
immediately after starting the URL request. That does not make sense because the request has not been completed at that point.
The correct way would be to call reloadData
and methodB
in connectionDidFinishLoading
, after you have updated your data source with the response from the URL request. At that point you know if the number of rows is zero or not, and there is no need to wait for the table view update to complete.