开发者

iphone, calling a method of different class in cocos2d layers?

I have two classes, both are subclasses of CCLayer, I want to call a meth开发者_如何学Good of first class into second class, what should I code?


Your question is not providing much detail, but from my understanding of what you say, you need the following:

  1. a selector in the public interface of your first class;

  2. a pointer ivar in the second class that you will properly initialize so that it points to an instance of the first class;

In this way you will be able to call the first class' method from the second class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜