首页 > 技术文章 > NotificationCenter观察模式

Anzhongliu 2016-06-22 21:40 原文

主要方法:

NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(jichen::getMsg), "test", nullptr);
	
NotificationCenter::getInstance()->postNotification("test",nullptr);//发送消息,调用方法

void jichen::getMsg(Ref* sender)
{//传递方法,无法传递数据
	log("getMsg in jichen");
}


推荐阅读