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:
a selector in the public interface of your first class;
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.
精彩评论