Class CCNotificationCenter

#include <Geode/cocos/support/CCNotificationCenter.h>
classCCNotificationCenter:publiccocos2d::CCObject{ ... }
No description provided
Examples0
Public static methods2
staticcocos2d::CCNotificationCenter*sharedNotificationCenter()

Gets the single instance of CCNotificationCenter.

staticvoidpurgeNotificationCenter()

Destroys the single instance of CCNotificationCenter.

Public member functions9
voidaddObserver(,,,)

Adds an observer for the specified target.

Parameters

target

The target which wants to observe notification events.

selector

The callback function which will be invoked when the specified notification event was posted.

name

The name of this notification.

obj

The extra parameter which will be passed to the callback function.
voidremoveObserver(,)

Removes the observer by the specified target and name.

Parameters

target

The target of this notification.

name

The name of this notification.
intremoveAllObservers()

Removes all notifications registered by this target

Parameters

target

The target of this notification.
Return value
the number of observers removed
voidregisterScriptObserver(,
inthandler
,)

Registers one hander for script binding.

Parameters

handler

The lua handler.

ℹ Only supports Lua Binding now.

voidunregisterScriptObserver(,)

Unregisters script observer

voidpostNotification()

Posts one notification event by name.

Parameters

name

The name of this notification.
voidpostNotification(,)

Posts one notification event by name.

Parameters

name

The name of this notification.

object

The extra parameter.
intgetScriptHandler()

Gets script handler.

Return value
The script handle.

ℹ Only supports Lua Binding now.

intgetObserverHandlerByName()

Gets observer script handler.

Parameters

name

The name of this notification.
Return value
The observer script handle.
Fields0
Protected member functions0
Protected fields0