I want to display the activity indicator after clicking a button. This button will update the app. I followed examples and documentation, but it does not work ...
- (void)viewDidLoad {
// .. snip
indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[self.view addSubview:indicator];
[indicator stopAnimating];
//indicator.hidden = TRUE;
//[indicator setHidden:YES];
}
-(IBAction)actAtualizar:(id)sender {
//[indicator setHidden:YES];
//indicator.hidden = FALSE;
[indicator startAnimating];
//[indicator setHidden:NO];
//[indicator stopAnimating];
//indicator.hidden = TRUE;
[self carregaDados];
NSLog(@"teste de atualizacao", nil);
}
-(void)carregaDados{
// ...
[indicator stopAnimating];
}