I have UITableView with a navigationBar at the top. I have a refresh button in the right of the navigationBar.
When clicking on the refresh button, i need to start an activity indicator, refresh the table and stop the activity indicator.
-(void)refreshClicked{
[spinner startAnimating]; //UIActivityIndicatorView object
[appDelegate readJSONData]; //this is the method which populates the array
//for displaying in the tableview
}
I want know how to refresh the table after populating the array and then how to stop the activity indicator.
thanks 🙂
Refresh table:
Stop activity indicator:
—–EDIT—–
From your comments, I can gather that you want to smoothly fade the spinner away and reload the tableview.
For the tableview:
You can reload sections of the tableview with a nice fade animation using the following code:
Your indexset contains all the sections you want to reload and you DO have other options for the reload animation. Look here: UITableViewRowAnimations
To create an NSIndexSet see this link
As for your spinner, you could fade it to alpha zero before calling stopAnimating by doing this: