pushScene调用后原先Scene中的点击事件还能被触发调用popScene报错


在SceneA中设置按钮1,按钮2,点击按钮2调用pushscene进入SceneB,在SceneB中点击SceneA的按钮1的位置,按钮1点击事件被触发,是不是应该在pushScene时对touchDispatcher进行处理?这时候点击SceneB中的按钮调用popScene会报错,内容如下:

  1. Assertion failure in -[CCTouchDispatcher forceAddHandler:array:], /Users/thomaszhu/Desktop/works/startGameParam/myTankDemo/libs/cocos2d/Platforms/iOS/CCTouchDispatcher.m:88
  2. Terminating app due to uncaught exception of class '_NSZombie_NSException'

libc++abi.dylib: terminate called throwing an exception

ios cocos2d

Sayori 11 years, 11 months ago

在pushScene的时候将原来的CCLayer的isTouchEnabled禁用

正经的看片绅士 answered 11 years, 11 months ago

Your Answer