API参考Foundation

NSNotification

通知对象(name/object/userInfo)。

NSNotification 表示一条通知(name、object、userInfo)。常见于 NSNotificationCenter 的 post/回调参数。

类成员 (Class members)

notificationWithNameObject

创建无 userInfo 的通知。

static notificationWithNameObject(aName: string, anObject: any): NSNotification

Parameters:

NameTypeDescription
aNamestring通知名。
anObjectany关联对象。

Return Value:

  • NSNotification: 新通知实例。

notificationWithNameObjectUserInfo

创建带 userInfo 的通知。

static notificationWithNameObjectUserInfo(aName: string, anObject: any, aUserInfo: NSDictionary): NSNotification

Parameters:

NameTypeDescription
aNamestring通知名。
anObjectany关联对象。
aUserInfoNSDictionary附加信息。

Return Value:

  • NSNotification: 新通知实例。

实例成员 (Instance members)

initWithNameObjectUserInfo

初始化通知实例。

initWithNameObjectUserInfo(name: string, object: any, userInfo: NSDictionary): void

Parameters:

NameTypeDescription
namestring通知名。
objectany关联对象。
userInfoNSDictionary附加信息。

Return Value:

  • 无。

相关

头文件API清单

正在加载...

协议:JSBNSNotification,来源:-