美文网首页
创建通知-通知的用法

创建通知-通知的用法

作者: 克拉克定律 | 来源:发表于2016-10-18 09:56 被阅读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];
    }
    

    相关文章

      网友评论

          本文标题:创建通知-通知的用法

          本文链接:https://www.haomeiwen.com/subject/ssnzyttx.html