API参考Foundation
NSNotification
通知对象(name/object/userInfo)。
NSNotification 表示一条通知(name、object、userInfo)。常见于 NSNotificationCenter 的 post/回调参数。
类成员 (Class members)
notificationWithNameObject
创建无 userInfo 的通知。
static notificationWithNameObject(aName: string, anObject: any): NSNotificationParameters:
| Name | Type | Description |
|---|---|---|
aName | string | 通知名。 |
anObject | any | 关联对象。 |
Return Value:
NSNotification: 新通知实例。
notificationWithNameObjectUserInfo
创建带 userInfo 的通知。
static notificationWithNameObjectUserInfo(aName: string, anObject: any, aUserInfo: NSDictionary): NSNotificationParameters:
| Name | Type | Description |
|---|---|---|
aName | string | 通知名。 |
anObject | any | 关联对象。 |
aUserInfo | NSDictionary | 附加信息。 |
Return Value:
NSNotification: 新通知实例。
实例成员 (Instance members)
initWithNameObjectUserInfo
初始化通知实例。
initWithNameObjectUserInfo(name: string, object: any, userInfo: NSDictionary): voidParameters:
| Name | Type | Description |
|---|---|---|
name | string | 通知名。 |
object | any | 关联对象。 |
userInfo | NSDictionary | 附加信息。 |
Return Value:
- 无。