
In creating our game
Word Crank, we decided that we would make the clickable block objects handle the touch events themselves instead of using the
CCScene object. In order to do that we had to implement the
CCTargetedTouchDelegate. A sample of the code can be found below:
Inside the Header File:
[sourcecode language="objc"]
@interface CustomSprite : CCSprite <CCTargetedTouchDelegate>
[/sourcecode]
Inside the Implementation File:
[sourcecode language="objc"]
- (void) onEnterTransitionDidFinish
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:1 swallowsTouches:YES];
}
- (void) onExit
{
[[CCTouchDispatcher sharedDispatcher] removeDelegate:self];
}
[/sourcecode]