0

我有一个UIImageView动画,我有一个启动或停止动画的功能。从另一个UIView类中我调用该函数,该函数被调用并且if statements工作,但不是 startAnimation。

这是启动或停止动画的函数:

-(void)runPlayerAnimation:(BOOL)run {
    if (run) [player startAnimating];
    else [player stopAnimating];
}

这是从类中调用函数的函数UIView

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CGPoint point = [[touches anyObject] locationInView:self];
if ([self pointInCircle:point]) {
    [self touchesMoved:touches withEvent:event];
    GameplayVC *a = [[GameplayVC alloc] init];
    [a runPlayerAnimation:YES];
}
}

两个类都像这样相互导入。在头文件@class中使用a,在实现文件#import中使用。

我已经NSLogged摆脱了这个功能,一切都在工作,除了startAnimating和可能stopAnimating也是。

4

0 回答 0