NSNotificationCenter
*nc = [
NSNotificationCenter
defaultCenter];
NSDictionary
*dict = @{@
"status"
:
@
"123"
};
[nc
postNotificationName:kNotificationChangeStatus object:
self
userInfo:dict];
NSNotificationCenter
*nc = [
NSNotificationCenter
defaultCenter];
[nc
addObserver:
self
selector:
@selector
(changeLabelText:)
name:kNotificationChangeStatus object:
nil
];
-
(
void
)changeLabelText:(
NSNotification
*)nf{
NSDictionary
*dict = nf.userInfo;
NSString
* isOn = dict[@
"status"
];
NSLog
(@
"%@"
,
isOn);
}
-
(
void
)dealloc{
[[
NSNotificationCenter
defaultCenter] removeObserver:
self
name:kNotificationChangeStatus object:
nil
];
}