Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Since the code to create the animation frames and the animation is common to all animations, you should consider encapsulating this into a helper method. I have done so in the project Sprite05_WithAnimHelper. Instead of using static methods, I decided to extend the CCAnimation class using an Objective-C feature called a category. It offers a way to add methods to an existing class without having to modify the original class. The only downside is that with a category you cannot add member variables to the class; you can only add methods. The following code is the @interface for the CCAnimation category, which I simply named Helper:
@interface CCAnimation (Helper)
+(CCAnimation*) animationWithFile:(NSString*)name
frameCount:(int)frameCount
delay:(float)delay;
@end