开发者

how to pass a int class variable from one class to another class in cocos2d

开发者 https://www.devze.com 2023-01-23 12:31 出处:网络
I have a game class sub class of CCLayer where i declare a int variable gameScore in .h file and initialize/update this variable in .m class.Now I need show this gameScore value in another class when

I have a game class sub class of CCLayer where i declare a int variable gameScore in .h file and initialize/update this variable in .m class.Now I need show this gameScore value in another class when game is over.But i don't know 开发者_开发问答how to do it.Infact i found severarl solution but most of them didn't work for me or i can't understand them properly.So i need a simple example of doing it.


i got solution by using singleton class

0

精彩评论

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

关注公众号