I am using activity indicator in iphone app but problem is that when I write the line
[indicator startAnimating];
in viewDidLoad, it animates but when I write this same line in the button code where I move to next screen then it does not animate
-(IBAction)nextButtonClicked{
if ([professionLabel.text isEqualToString:@"Profession"]) {
errorLabel.text=@"Please Select the Highliteg Answers";
Q1.textColor=[UIColor redColor];
}
if ([workLabel.text isEqualToString:@"Work"]) {
errorLabel.text=@"Please Select the Highlight Answers";
Q2.textColor=[UIColor redColor];
}
if([yearLabel.text isEqualToString:@"Year"]){
errorLabel.text=@"Please Select the Highliteg Answers";
Q3.textColor=[UIColor redColor];
}
else{
errorLabel.text=@"";
Q1.textColor=[UIColor ];
Q2.textColor=[UIColor];
Q3.textColor=[UIColor];
[indicator startAnimating];
[self submitSurveyAnswers];
[self submitSurveyAnswersOne];
[self submitSurveyAnswersTwo];
OnlineViewController*targetController=[[OnlineViewController alloc]init];
targetController.mynumber=mynumber;
[self.navigationController pushViewController:targetController animated:YES];
}
}