创建通知-通知的用法

2016-10-18  本文已影响19人  克拉克定律

1.创建通知

创建通知

NSNotification *notification = [NSNotificationnotificationWithName:@"refresh" object:niluserInfo:dictplist];

通过通知中心发送通知

[[NSNotificationCenter defaultCenter] postNotification:notification];

2.接收通知并进行相依处理

接收通知

- (void)refresh:(NSNotification *)text
{    
  NSLog(@"%@",text.userInfo);   
  self.dic = [[NSMutableDictionary alloc] initWithDictionary:text.userInfo];    
  NSLog(@"-----接收到通知------");   
  [self.leftTableView reloadData];  
  [self.rightTableView reloadData];
}
上一篇 下一篇

猜你喜欢

热点阅读