我cocos2d,我正在使用pushscene和replacesene移动到下一个场景。但是,我很困惑我们应该使用哪一种?
当我在某些地方使用replacesene时,应用程序崩溃并出现错误,比如
-[UITextView length]: unrecognized selector sent to instance 0x842a750
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UITextView length]: unrecognized selector sent to instance 0x842a750'
但是,在我的程序中,我不会将长度传递给uitextview。我的程序是这样的
在scene1中,我有uitextview,我将用scene2替换此场景。然后
-(id)buttonPressed:(id)sender
{
[description removeFromSuperview]; // It is the textView(description)
CCScene *Scene = [CCScene node];
CCLayer *Layer = [scene2 node];
[Scene addChild:Layer];
[[CCDirector sharedDirector] setAnimationInterval:1.0/60];
[[CCDirector sharedDirector] replaceScene: Scene];
}
但是,当我在重播现场使用pushscene时,它工作得很好。请澄清在哪种情况下应该使用哪一个?
谢谢您