我尝试使用执行选择器两次调用此方法
-(void)time:(UILabel *)label{
float duration = (label.frame.size.width + self.view.frame.size.width)/111;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationRepeatCount:1e100f];
label.center = CGPointMake(label.center.x , label.center.y +700);
[UIView commitAnimations];
}
使用执行选择器,但仅在调用一次。
[self performSelector:@selector(time:) withObject:testLabel afterDelay:0];
[self performSelector:@selector(time:) withObject:testLabel1 afterDelay:5];
只有第一个被调用。我做错了吗?