In my init method I init frames for an animation like this.
walkingFrames = [NSMutableArray array];
for(int i =2; i<34; i = i+2){
if(i<10){
[walkingFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName: [NSString stringWithFormat:@"Frame-00%d.tif", i]]];
}
else{
[walkingFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName: [NSString stringWithFormat:@"Frame-0%d.tif", i]]];
}
}
where walkingFrames is defined in the header file.
When I try to create an animation like this in my update method I get a bad_access.
CCAnimation *walkingAnimation = [CCAnimation animationWithSpriteFrames:walkingFrames delay:animationWalkingSpeed];
self.walkAction = [CCRepeatForever actionWithAction:
[CCAnimate actionWithAnimation:walkingAnimation]];
[_guy runAction:_walkAction];
where walkAction is a CCAction property.
I am having a hard time solving what is going wrong.