iOS - Transition with scene error

59 Views Asked by At

I am working on an application, which uses cocos2D. It works very well, but I have a problem during some transitions. Sometimes, I get an error when I use:

[[CCDirector sharedDirector] replaceScene:[Menu scene]];

I get:

Unbalanced calls to begin/end appearance transitions for <MyViewController>

I see with this link that there is for example two same view controllers at the same time, or other things like this. I also see that I must use:

setAnimated:NO

to solve this problem. But I can't with a CCScene.

How could I fix this problem please?

Thanks for your help!

Additional code :

WillExit:^{
    // This code is called when exiting the portal                                
    [[NSUserDefaults standardUserDefaults] synchronize];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[CCDirector sharedDirector] replaceScene:[Menu scene]];
    //[[CCDirector sharedDirector].view setanimated:NO]; I try some things like this...
 }];
0

There are 0 best solutions below