I get the following error report after my game crashes on startup.
When I try to replace the scene using
[[CCDirector sharedDirector]replaceScene:[CCZoomFlipXTransition transitionWithDuration:1 scene:[MainMenu node]]];
I get the error and it crashes the app.
* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSMutableArray replaceObjectAtIndex:withObject:]: index 4294967295 beyond bounds for empty array'
What is the cause of this, I'm not sure what I am doing wrong?
T开发者_如何学Gohanks
If it's the first scene you are loading you need to use runWithScene not replaceScene.
[[CCDirector sharedDirector] runWithScene:[MainMenu scene]];
精彩评论