I use the CABasicAnimation to animate the rotation of a NSView. The code runs well on iPhone and now I want to plant it to the cocoa.
[self.secondView setWantsLayer:YES];
CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
anim2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
anim2.fromValue = [NSNumber numberWithFloat:0];
anim2.toValue = [NSNumber numberWithFloat:-((360*M_PI)/180)];
anim2.repeatCount = HUGE_VALF;
anim2.duration = 8.0;
[self.secondView.layer addAnimation:anim2 forKey:@"transform"];
When it runs, the view’s frame seems to be covered,like below:

You can see the four vertexes are not shown.
As I’m not so familiar with cocoa, could anyone tell me where is the problem?
Thanks!
I set the configuration in the nib file:
the secondView is a
NSImageView, and makes the view in theCore Animation Layer, but leaves theImage Wellunselected.But could anyone how to make the configurations in code?
I can’t find anything in the
NSImageViewDocument.