i want display an activity indicator over a uitableview while it\'s loading data (in another thread). So in the ViewDidLoad method of the UITableViewController:
[IOS 8+] The above does not work for me. Instead I store the indicator view (ac) in the class. Then I do:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (ac.isAnimating)
return 50.0f;
return 0.0f;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (ac.isAnimating)
return ac;
return nil;
}
For showing the indicatorview I do
[ac startAnimating]
For hiding it, I do
[ac stopAnimating]