찾다

 >  Q&A  >  본문

ios - 动画组 运行时崩溃

代码如下

 __block NSMutableArray *animaArr = [[NSMutableArray alloc] initWithCapacity:200];
for ( int i = 3 ; i > 0 ; i-- ) { 
            CAKeyframeAnimation *anima1 = [CAKeyframeAnimation animationWithKeyPath:@"position"];
            NSValue *value0 = [NSValue valueWithCGPoint:CGPointMake(30,40)];
            NSValue *value1 = [NSValue valueWithCGPoint:CGPointMake(50,60)];
            anima1.values = [NSArray arrayWithObjects:value0,value1, nil];
            [animaArr addObject:anima1.values];
        }
        
CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];
groupAnimation.animations = animaArr;
groupAnimation.duration = 5;
[_movingChipImgView.layer addAnimation:groupAnimation forKey:nil];

崩溃信息

-[__NSArrayI setDefaultDuration:]: unrecognized selector sent to instance 0x608000222800
怪我咯怪我咯2771일 전393

모든 응답(1)나는 대답할 것이다

  • 高洛峰

    高洛峰2017-04-18 09:51:20

    [animaArr addObject:anima1.values]; ==> [animaArr addObject:anima1];

    회신하다
    0
  • 취소회신하다