Hey guys,
Sorry if this isn't the right place for this question. I'm hoping someone can help me out here. I'm working on my first game and so far I've been able to resolve all of my issues by just searching and experimenting but I'm afraid this one I can't figure out.
I'm trying to animate a sprite and was following the instructions on Ray Wenderlich's blog. The tutorial I was following is a little old and with the rate of change, I expect to have to make some adjustments. I'm not really sure what's wrong here though.
Here's my code:
NSMutableArray *swIdleFrames = [NSMutableArray array];
for(int i = 1; i <= 5; i++)
{
[swIdleFrames addObject:[CCSprite spriteWithFile:[NSString stringWithFormat:@"stopwatch0%d.png",i]]];
}
CCAnimation *swIdleAnim = [CCAnimation animationWithFrames:swIdleFrames delay:0.05f];
self.swIdle = [CCRepeatForever actionWithAction:
[CCAnimate actionWithAnimation:swIdleAnim restoreOriginalFrame:NO]];
[stopWatch runAction:self.swIdle];
swIdle is a CCAction object and stopWatch is a CCSprite. As far as I can tell it's not recognizing swIdle as a valid argument for the runAction method of stopWatch. I also tried changing swIdle from a CCAction to id as I've seen done in most of the examples that I've seen but I received the same error.
I'm doing a lot of fiddling around with different interface elements and this is really slowing me down. I thought it would be easy to toss a simple animation in but it's turned out to be a major headache.
Can anyone help me out please?