I've added this function.
- (void) registerWithTouchDispatcher {
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
}
error: sharedDispatcher
is deprecated
what does it mean and what shall I do?
Take a look at ccDeprecated.h
, it says to use:
[[CCDirector sharedDirector] touchDispatcher]
Change: [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
To: [[[CCDirector sharedDirector] touchDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
You can check the Cocos2D code behind any Cocos (CC) method by pressing 'Shift+Command' keys and hovering on the method. Doing so on any deprecated method will take you to CCDeprecated.m which will also give you the new method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With