cocos2d/cocos2d-iphone-extensions — Issue #93: CCScrollLayer doesn't call delegate method when [scrollLayer selectPage:1];
Author: draganjovev
Created: 2011-12-08 13:17:30+00:00
State: open

Steps to reproduce issue

scrollLayer = [[CCScrollLayer alloc] initWithLayers:someLayers
widthOffset:0];
[scrollLayer selectPage:1];
[scrollLayer setDelegate:self];
[self addChild:scrollLayer];

- (void) scrollLayer: (CCScrollLayer *) sender scrolledToPageNumber: (int) page {
NSLog(@"Delegate called");
}

Since you're on page 1, try to go to page 0 and you will see that delegate method is not called because currentScreen_ and prevScreen_ are equal.

Solution si to replace line 119 to

currentScreen_ = NSNotFound;