2

I am using cocos2d for android (ZhouWeikuan version). The CCCallFunc is not working anywhere. It is always throwing NoSuchMethodException. A code snippet

...
CCJumpBy action7 = CCJumpBy.action(0.4f, CGPoint.ccp(60f,0f), 30f, 1);
        CCJumpBy action8 = CCJumpBy.action(0.4f, CGPoint.ccp(-60f,0f), 30f, 1);
        CCCallFuncN action9 = CCCallFuncN.action(this,"stopDancing");
        CCSequence action10 = CCSequence.actions(action1,action2,action3,action4,action5,action6,action7,action8,action9);
        this.runAction(action10);
...

"stopDancing" is in the same class. I think there is a problem in this.

Nikhil Ranjan
  • 994
  • 12
  • 16
  • You should post the stack trace and the stopDancing method. My bet would be a problem on the parameters of the stopDancing method. – Sebastien Jun 22 '12 at 09:58

1 Answers1

2

You need to create your method as public which contains one argument as Object

so your method will looks like this

public void stopDancing(Object sender){    
//Your code...
......    
}
Mihir Palkhiwala
  • 2,586
  • 3
  • 37
  • 47