Heim > Fragen und Antworten > Hauptteil
代码如下
__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