我有一个要求,当用户单击登录屏幕上的提交按钮时,我需要为 a 设置动画UIActivityIndicator
,但是 - 使用下面的代码 - 它不是动画:
-(IBAction)loginButtonAction:(id)sender {
[currenttextfield resignFirstResponder];
[self.spinner startAnimating];
BOOL valid=[self emailvalidate];
if(valid) {
if (!self.passwordstring.length ==0 && ![self.passwordstring isEqualToString:@" "] && ![self.passwordstring isEqualToString:nil] && !self.emailstring.length ==0 && ![self.emailstring isEqualToString:@" "] && ![self.emailstring isEqualToString:nil] ) {
[self performSelectorOnMainThread:@selector(sendDetails) withObject:nil waitUntilDone:YES];
}
}
}
此方法首先调用EmailValidate返回一个BOOL
值。如果有效,则调用发送详细信息方法,在该方法中我调用存储库来检查值。完成后,我停止活动指示器。有谁知道如何解决上述问题?