* Assertion failure in -[CCTouchDispatcher forceAddHandler:array:], /libs/cocos2d/Platforms/iOS/CCTouchDispatcher.m:108
* Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Delegate already added to
touch dispatcher.’
The line causing it is
skillsMenu.isTouchEnabled = YES;
skillsMenu is just a CCMenu. I like to enable/disable it with the above line often.
The problem is, I don’t know how to interpret this error properly – I have no clue why would setting this property cause such error.
Perhaps it was wrong to use that line in the first place. Is there not a better way to enable/disable a CCMenu?
cocos2d-iphone 1.0.1
isTouchEnabledregisters/unregisters the touch handler for the object.Registering and unregistering of touch handlers in the same step has caused problems in the past, although, in more recent versions, I believe this has been fixed.
In any case, if you simply want to temporarily enable/disable a menu, it will be less problematic to enable/disable the individual menu items: