NSNotificationCenter equivalent in C++

NSNotificationCenter equivalent in C++

本文关键字:C++ in equivalent NSNotificationCenter      更新时间:2023-10-16

最近我从Cocos2d-iPhone切换到Cocos2d-x。在编写Objective-C代码时,我发现NSNotificationCenter在某些情况下非常有用。我想在用C++编写的 Cocos2d-x 项目中使用类似的东西。

我不认为编写我自己相对简单的通知中心会太难。在我重新发明轮子之前,我认为应该问一下:在编写在Android和iOS上运行C++代码时,NSNotificationCenter相当于什么?

cocos2d-x 中有 CCNotificationCenter 类。