新建通知 和 要通知的内容
NSDictionary* dic =
@{@"username":username};
[[NSNotificationCenter
defaultCenter]postNotificationName:@"didReciveBuddyRequest"
object:nil
userInfo:dic];
然后监听通知 并解析info
[[NSNotificationCenter
defaultCenter]addObserver:self
selector:@selector(didreceiveRequest:)
name:@"didReciveBuddyRequest"
object:nil];
-(void)didreceiveRequest:(NSNotification*)info
{
NSDictionary* dic = [info
userInfo];
NSString* username = [dic
objectForKey:@"username"];
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-18 07:54:24