标签:
1. 定义回调接口类:
class UIcallBack { public: virtual void onAppActivated() = 0; virtual void onShowMore() = 0; };
class AppManager : public UIcallBack { public: AppManager(); UIManager uiManager; ……
uiManager.setCallBack(this);
void AppManager::onAppActivated() { } void AppManager::onShowMore() { _D("callback onshowMore\n"); }
class UIManager { public: UIManager(); ~UIManager(); void setCallBack(UIcallBack *pcallBack) { m_pcallBack = pcallBack; } UIcallBack *m_pcallBack; };
m_pcallBack->onShowMore();
标签:
原文地址:http://blog.csdn.net/liukang325/article/details/45742675