使用performselector - 两次使用相同的方法

时间:2012-10-11 17:41:33

标签: ios xcode performselector

我试图使用执行选择器

两次调用此方法
-(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];

只调用第一个。我做错了吗?

1 个答案:

答案 0 :(得分:1)

2次使定时器无效后,使用定时器2调用功能两次

相关问题