1

I am trying to move an image along a pre defined path. I used the code below. but it says things like:

CAKeyframeAnimation undeclared
kCAAnimationPaced undeclared 

I am new to iPhone development, please help me.

*pathAnimation = [CAKeyframeAnimationanimationWithKeyPath:@"position"];
pathAnimation.duration = 1.0f;
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = NO;

CGMutablePathRef pointPath = CGPathCreateMutable();
CGPathMoveToPoint(pointPath, NULL, 492, 128);
CGPathAddLineToPoint(pointPath, NULL, 480, 150);
CGPathAddLineToPoint(pointPath, NULL, 489, 160);
CGPathAddLineToPoint(pointPath, NULL, 489, 180);
pathAnimation.path = pointPath;
CGPathRelease(pointPath);

[imageview.layer addAnimation:pathAnimation forKey:@"pathAnimation"];
Abizern
  • 146,289
  • 39
  • 203
  • 257
Abdullah
  • 11
  • 2

1 Answers1

4

You must have not imported the framework. Import it (See this for help )and add #import <QuartzCore/QuartzCore.h> to your *.pch file.

Community
  • 1
  • 1
Deepak Danduprolu
  • 44,595
  • 12
  • 101
  • 105