Тип получателя «UIView» для сообщения экземпляра не объявляет метод с селектором «addAnimation: forKey:» - PullRequest
0 голосов
/ 02 марта 2012
CABasicAnimation *theAnimation; 
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
theAnimation.duration=0.5;
theAnimation.repeatCount=0;
theAnimation.autoreverses=NO;
theAnimation.fromValue=[NSNumber numberWithFloat:100];
theAnimation.toValue=[NSNumber numberWithFloat:0];
//[self.quntityView animationDidStart:theAnimation];
[self.quntityView addAnimation:theAnimation forKey:@"animateLayer"];

1 Ответ

0 голосов
/ 02 марта 2012

addAnimation:forKey: - это метод на CALayer.Вы не можете просто позвонить на UIView.

Попробуйте:

[self.quntityView.layer addAnimation:theAnimation forKey:@"animateLayer"];
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...