我在 iphone 应用程序中使用活动指示器,但问题是当我写行时
[indicator startAnimating];
在 viewDidLoad 中,它会产生动画,但是当我在按钮代码中写下同一行时,我会移至下一个屏幕,然后它不会产生动画
-(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];
}
}