2

I am using cocos2d for android. The CCCallFunc is not working anywhere. It is always throwing NoSuchMethodException.

The CCCallFuncN

CCCallFuncN hideFunction = CCCallFuncN.action(this,
                    "hidesSprite");

My method

public void hidesSprite (CCNode sprite) {
        sprite.setVisible(false);
    }

This code is in public class PageLayer extends CCLayer

Ivan Mir
  • 1,209
  • 1
  • 12
  • 32
rei_ayanami
  • 135
  • 1
  • 9

1 Answers1

0

I solved the problem by changing the parameter type to Object:

    public void hidesSprite (Object sender) {

        Sprite sprite = (Sprite) sender;
        sprite.setVisible(false);
    }
rei_ayanami
  • 135
  • 1
  • 9