Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sharedDispatcher is missing from CCTouchDispatcher (Cocos2D 2.0 beta2), what should I use instead?

When I try to call [CCTouchDispatcher sharedDispatcher];, it shows an error that the class method sharedDispatcher is missing. I go to the .h file of CCTouchDispatcher and found that sharedDispatcher is really missing! I am using Cocos2D 2.0 beta2. Is it removed from this version? If so what should I use to replace it. (may be [[CCTouchDispatcher alloc] init])

like image 595
Hlung Avatar asked Mar 05 '12 12:03

Hlung


1 Answers

Just found an answer here https://stackoverflow.com/a/9059809/467588. You have to use this instead...

[[CCDirector sharedDirector] touchDispatcher]

I will still post this question anyway because that one's title is not comprehensive and hard to search, or until its owner accept my edit :)

like image 92
Hlung Avatar answered Sep 29 '22 10:09

Hlung