Instance Method

postNotificationName:object:userInfo:deliverImmediately:

Creates a notification with information and an immediate-delivery specifier, and posts it to the receiver.

Declaration

- (void)postNotificationName:(NSNotificationName)name object:(NSString *)object userInfo:(NSDictionary *)userInfo deliverImmediately:(BOOL)deliverImmediately;

Parameters

notificationName

Name of the notification to post. Must not be nil.

notificationSender

Sender of the notification. May be nil.

userInfo

Dictionary containing additional information. May be nil.

deliverImmediately

Specifies when to deliver the notification. When NO, the receiver delivers notifications to their observers according to the suspended-notification behavior specified in the corresponding dispatch table entry. When YES, the receiver delivers the notification immediately to its observers.

Discussion

This is the preferred method for posting notifications.

The notificationInfo dictionary is serialized as a property list, so it can be passed to another task. In the receiving task, it is deserialized back into a dictionary. This serialization imposes some restrictions on the objects that can be placed in the notificationInfo dictionary. See XML Property Lists for details.

See Also

Posting Notifications

- postNotificationName:object:

Creates a notification, and posts it to the receiver.

- postNotificationName:object:userInfo:

Creates a notification with information, and posts it to the receiver.

- postNotificationName:object:userInfo:options:

Creates a notification with information, and posts it to the receiver.