I have a Sprite class: GameTable, which has a class method "scene()". And an instance method "init()".
+(id)scene creates a [Scene node], a [GameTable node] (which executes the init()), then returns the Scene *.
The init() creates some sprites and add them to self by [self addChild:theSprite z:...];
Now, if during startup (in the appdelegate method) I create the scene by:
Scene *theScene = [[GameTable scene] retain];
When I call the [[Director sharedDirector] runWithScene:theScene], I see a black background with some white boxes that should be the sprites created in the init().
If I call the [[Director sharedDirector] runWithScene:[GameTable scene]], I see a full-white screen.
The only way to make things working is to remove the [[GameTable scene] retain] at startup (however called AFTER initializing the director's stuff), and use the [[Director sharedDirector] runWithScene:[GameTable scene]] syntax.
Ok, let's suppose I did something wrong in the startup: creating my scene when cocos2d is not ready. Why a second call to [Gametable scene] doesn't work properly?
How can I switch between scenes if I cannot create two scenes at startup?