I choose to use NSNotificationCenter to deal with some events when I work on cocos2d-iphone. If I add a target and a event to NSNotificationCenter, I will remove the target from Center in the target`s destructor.like this:
[[NSNotificationCenter defaultCenter] removeObserver:self];
Now, on the cocos2d-html5, I find it has a CCNotificationCenter. But I was first to use JS in which I don`t find a method like a destructor. So, I don`t know when is a best time to remove the target from Center.
Anyone can give some advices？ Thx a lot.