I have a problem with the run-action method for CCAnimation. If I run CCNAt in the initWithBodyPartImage after running the command If made, then it will work properly with errors. But, if I call the run action method with the ccTouchBegan function, the app will crash and no errors are printed in the console. So it is very difficult to figure out why the app is crashing when I call the run action method from a different function. If anyone could help me with this, I used to appreciate it much?
- (id) initWithBodyPartImage {// If the body part is being loaded using a phantom frame name (for example file name) ((self = [super initWithSpriteFrameName: @ " Align_01.png "]))) {state = kBodyPartUnTouched; // Create an animation object from all phantom animation frames anime [CC Animation AnimationEfframe: @ "Alliance_" Framecount: 7 Delay: 0.08f]; // Run an animation using CNNit Action Animatimate = [CC Animation Action with Animation: Anem]; // CCRepeatForever * Repeat = [CCRepeatAververctionWithActionAction: Animate]; Repeat = [Action with CCRepeat Action: Animate Time: 1]; [Speed run action: repeat]; // it will work ok} return yourself; } - (BOOL) ccTouchBegan: (UITT *) Dagent with touch: (UIEvent *) Event {[Run it: repeat]; // This is where app crash status = kBodyPartTouched; Yes come back }
You need to retain and release them in dealloc. Consider using the properties.
Comments
Post a Comment