cocos2d/cocos2d-iphone-extensions — Issue #97: CCScrollLayer: Possible break Fix if CCTouchDispatcher will be changed.
Author: psineur
Created: 2012-02-25 18:30:27+00:00
State: open
Labels: TODO

Thankfully to @SG7, possible break of CCScrollLayer (if this pull request get merged: https://github.com/cocos2d/cocos2d-iphone/pull/171 ) can be easily fixed like this:

```
//- (NSMutableArray *) targetedHandlers;
- (CCArray	*) targetedHandlers;

@end

@implementation CCTouchDispatcher (targetedHandlersGetter)

//- (NSMutableArray *) targetedHandlers
- (CCArray	*) targetedHandlers
{
return targetedHandlers;
}

@end // and the only place when internal array is used:

//	for ( CCTargetedTouchHandler *handler in [[CCTouchDispatcher sharedDispatcher] targetedHandlers] )

CCTargetedTouchHandler *handler;
CCArray array = [[CCTouchDispatcher sharedDispatcher] targetedHandlers];
CCARRAY_FOREACH(array, handler) {
//...
}
```