#[repr(C)]pub struct NSNotification {
pub ptr: Id<Object>,
}
Expand description
A container for information broadcast through a notification center to all registered observers.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSNotification
impl NSNotification
Sourcepub fn init_with_coder(&mut self, coder: &NSCoder) -> Self
pub fn init_with_coder(&mut self, coder: &NSCoder) -> Self
Initializes a notification with the data from an unarchiver.
Sourcepub fn notification_with_name_object(
name: NSNotificationName,
object: id,
) -> Self
pub fn notification_with_name_object( name: NSNotificationName, object: id, ) -> Self
Returns a new notification object with a specified name and object.
Sourcepub fn notification_with_name_object_user_info(
name: NSNotificationName,
object: id,
user_info: NSDictionary<id, id>,
) -> Self
pub fn notification_with_name_object_user_info( name: NSNotificationName, object: id, user_info: NSDictionary<id, id>, ) -> Self
Returns a notification object with a specified name, object, and user information.
Sourcepub fn init_with_name_object_user_info(
&mut self,
name: &NSNotificationName,
object: id,
user_info: &NSDictionary<id, id>,
) -> Self
pub fn init_with_name_object_user_info( &mut self, name: &NSNotificationName, object: id, user_info: &NSDictionary<id, id>, ) -> Self
Initializes a notification with a specified name, object, and user information.
Sourcepub fn name(&self) -> NSNotificationName
pub fn name(&self) -> NSNotificationName
The name of the notification.
Sourcepub fn user_info(&self) -> NSDictionary<id, id>
pub fn user_info(&self) -> NSDictionary<id, id>
The user information dictionary associated with the notification.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.