0

実行セレクターを使用してこのメ​​ソッドを 2 回呼び出そうとしています

-(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];

最初のものだけが呼び出されます。私はそれを間違っていますか?

4

1 に答える 1

1

タイマー2コール機能を2回使用後、タイマーを無効化

于 2012-10-11T17:44:34.437 に答える