As @LearnCocos2D says, viewWillLayoutSubviews
is forced repeatedly , And I used to create new scene everytime it has been called. So I need to check if SKView.scene property is not nil. Here is the code:
-(void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
SKView* skView = (SKView*)self.view;
if(!skView.scene){
SceneA *sceneA = [SceneA sceneWithSize:self.view.bounds.size];
sceneA.scaleMode = SKSceneScaleModeAspectFill;
[skView presentScene:sceneA];
}
}