This is what I use (that allows transitions)
.h`
import "cocos2d.h"
@interface CCDirector (CCDirectorPopScene)
// honestly, why does this not exist?
- (void) popSceneWithTransition: (Class)c duration:(ccTime)t;
@end
.m
import "CCDirectorPopScene.h"
@implementation CCDirector (CCDirectorPopScene)
// honestly, why does this not exist?
-(void) popSceneWithTransition: (Class)transitionClass duration:(ccTime)t;
{
NSAssert( runningScene_ != nil, @"A running Scene is needed");
[scenesStack_ removeLastObject];
NSUInteger c = [scenesStack_ count];
if( c == 0 ) {
[self end];
} else {
CCScene* scene = [transitionClass transitionWithDuration:t scene:[scenesStack_ objectAtIndex:c-1]];
[scenesStack_ replaceObjectAtIndex:c-1 withObject:scene];
nextScene_ = scene;
}
}
@end
`
EDIT: I realize this is not exactly what you asked for, but the code should be enough to give you an idea on how to extend the CCDirector easy enough.