仅当操作花费太多时间时,我才想启动我的 UIActivityIndicator:
- (void) continueLaunch {
//operations
//.....
[activityIndic stopAnimating];
}
//my current method
- (void)lauchApplication {
[activityIndic startAnimating];
[self performSelector:@selector(continueLaunch) withObject:nil afterDelay:0.0f];
}
//what I want to do
- (void)lauchApplication {
if ([self performSelector:@selector(continueLaunch) withObject:nil afterDelay:0.0f]duration > 1 second){
[activityIndic startAnimating];
}
}
我怎样才能做到这一点 ?