#include <CCNotificationCenter.h>
void addObserver |
( |
Ref * |
target, |
|
|
SEL_CallFuncO |
selector, |
|
|
const std::string & |
name, |
|
|
Ref * |
sender |
|
) |
| |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
var addObserver |
( |
var |
target, |
|
|
var |
selector, |
|
|
var |
name, |
|
|
var |
sender |
|
) |
| |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
local addObserver |
( |
local |
target, |
|
|
local |
selector, |
|
|
local |
name, |
|
|
local |
sender |
|
) |
| |
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. |
sender | The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target. |
static void destroyInstance |
( |
| ) |
|
|
static |
local destroyInstance |
( |
| ) |
|
|
static |
int getObserverHandlerByName |
( |
const std::string & |
name | ) |
|
Gets observer script handler.
- Parameters
-
name | The name of this notification. |
- Returns
- The observer script handle.
var getObserverHandlerByName |
( |
var |
name | ) |
|
Gets observer script handler.
- Parameters
-
name | The name of this notification. |
- Returns
- The observer script handle.
local getObserverHandlerByName |
( |
local |
name | ) |
|
Gets observer script handler.
- Parameters
-
name | The name of this notification. |
- Returns
- The observer script handle.
int getScriptHandler |
( |
| ) |
const |
|
inline |
Gets script handler.
- Note
- Only supports Lua Binding now.
- Returns
- The script handle.
Gets script handler.
- Note
- Only supports Lua Binding now.
- Returns
- The script handle.
local getScriptHandler |
( |
| ) |
|
|
inline |
Gets script handler.
- Note
- Only supports Lua Binding now.
- Returns
- The script handle.
void postNotification |
( |
const std::string & |
name | ) |
|
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
var postNotification |
( |
var |
name | ) |
|
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
local postNotification |
( |
local |
name | ) |
|
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
void postNotification |
( |
const std::string & |
name, |
|
|
Ref * |
sender |
|
) |
| |
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
var postNotification |
( |
var |
name, |
|
|
var |
sender |
|
) |
| |
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
local postNotification |
( |
local |
name, |
|
|
local |
sender |
|
) |
| |
Posts one notification event by name.
- Parameters
-
name | The name of this notification. |
sender | The object posting the notification. Can be nullptr |
static void purgeNotificationCenter |
( |
void |
| ) |
|
|
static |
var purgeNotificationCenter |
( |
|
| ) |
|
|
static |
local purgeNotificationCenter |
( |
|
| ) |
|
|
static |
void registerScriptObserver |
( |
Ref * |
target, |
|
|
int |
handler, |
|
|
const std::string & |
name |
|
) |
| |
Registers one hander for script binding.
- Note
- Only supports Lua Binding now.
- Parameters
-
var registerScriptObserver |
( |
var |
target, |
|
|
var |
handler, |
|
|
var |
name |
|
) |
| |
Registers one hander for script binding.
- Note
- Only supports Lua Binding now.
- Parameters
-
local registerScriptObserver |
( |
local |
target, |
|
|
local |
handler, |
|
|
local |
name |
|
) |
| |
Registers one hander for script binding.
- Note
- Only supports Lua Binding now.
- Parameters
-
int removeAllObservers |
( |
Ref * |
target | ) |
|
Removes all notifications registered by this target.
- Parameters
-
target | The target of this notification. |
- Returns
- the number of observers removed
var removeAllObservers |
( |
var |
target | ) |
|
Removes all notifications registered by this target.
- Parameters
-
target | The target of this notification. |
- Returns
- the number of observers removed
local removeAllObservers |
( |
local |
target | ) |
|
Removes all notifications registered by this target.
- Parameters
-
target | The target of this notification. |
- Returns
- the number of observers removed
void removeObserver |
( |
Ref * |
target, |
|
|
const std::string & |
name |
|
) |
| |
Removes the observer by the specified target and name.
- Parameters
-
target | The target of this notification. |
name | The name of this notification. |
var removeObserver |
( |
var |
target, |
|
|
var |
name |
|
) |
| |
Removes the observer by the specified target and name.
- Parameters
-
target | The target of this notification. |
name | The name of this notification. |
local removeObserver |
( |
local |
target, |
|
|
local |
name |
|
) |
| |
Removes the observer by the specified target and name.
- Parameters
-
target | The target of this notification. |
name | The name of this notification. |
var sharedNotificationCenter |
( |
|
| ) |
|
|
static |
local sharedNotificationCenter |
( |
|
| ) |
|
|
static |
void unregisterScriptObserver |
( |
Ref * |
target, |
|
|
const std::string & |
name |
|
) |
| |
Unregisters script observer.
var unregisterScriptObserver |
( |
var |
target, |
|
|
var |
name |
|
) |
| |
Unregisters script observer.
local unregisterScriptObserver |
( |
local |
target, |
|
|
local |
name |
|
) |
| |
Unregisters script observer.
The documentation for this class was generated from the following file: