public class NSNotificationCenter extends NSObject
Modifier and Type | Method and Description |
---|---|
void |
addObserver(NSSelector<NSNotification> observer,
String aName,
Object anObject)
Adds an observer for the specified notification
|
static NSNotificationCenter |
defaultCenter()
Returns the default notification center.
|
void |
postNotification(NSNotification notification)
Posts the specified notification.
|
void |
postNotificationName(String aName,
Object anObject) |
void |
postNotificationName(String aName,
Object anObject,
Map<String,?> aUserInfo) |
void |
removeObserver(NSSelector<NSNotification> observer) |
void |
removeObserver(NSSelector<NSNotification> observer,
String aName,
Object anObject) |
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public static NSNotificationCenter defaultCenter()
public void addObserver(NSSelector<NSNotification> observer, String aName, Object anObject)
observer
- The object registered as an observer. Not NULL.aName
- The name of the notification.anObject
- The object whose notifications will be received the
observer.public void removeObserver(NSSelector<NSNotification> observer)
public void removeObserver(NSSelector<NSNotification> observer, String aName, Object anObject)
public void postNotificationName(String aName, Object anObject, Map<String,?> aUserInfo)
public void postNotification(NSNotification notification)
notification
- The notification to post.Not NULL.Copyright © 2020. All rights reserved.