Instance Method

removeObserver:name:object:

Removes matching entries from the receiver’s dispatch table.

Declaration

- (void)removeObserver:(id)observer name:(NSNotificationName)aName object:(NSString *)anObject;

Parameters

notificationObserver

Observer to remove from the dispatch table. Specify an observer to remove only entries for this observer. When nil, the receiver does not use notification observers as criteria for removal.

notificationName

Name of the notification to remove from dispatch table. Specify a notification name to remove only entries that specify this notification name. When nil, the receiver does not use notification names as criteria for removal.

notificationSender

Sender to remove from the dispatch table. Specify a notification sender to remove only entries that specify this sender. When nil, the receiver does not use notification senders as criteria for removal.

Discussion

Be sure to invoke this method with notificationName:nil notificationSender:nil (or removeObserver:) before deallocating the observer object.

See Also

Managing Observers

- addObserver:selector:name:object:

Adds an entry to the notification center's dispatch table with an observer, a selector, and an optional notification name and sender.

- addObserver:selector:name:object:suspensionBehavior:

Adds an entry to the receiver’s dispatch table with a specific observer and suspended-notifications behavior, and optional notification name and sender.