IOS使用通知回调方法

    //1:发布通知-----通知回调方法

    NSNotificationCenter *refreshWebNotice = [NSNotificationCenterdefaultCenter];

    [refreshWebNotice postNotificationName:@"refreshWeb" object:nil];

 //2:接收通知----通知回调方法刷新网页;refreshweb

     [[NSNotificationCenterdefaultCenter] addObserver:selfselector:@selector(refreshWeb) name:@"refreshWeb"object:nil];

 //3: 通知回调方法;

  -(void)refreshWeb

  {

      [selfgetWebPage];

  }

 //4:用完之后释放通知

  - (void)dealloc

  {

       [[NSNotificationCenterdefaultCenter]removeObserver:selfname:@"refreshWeb"object:nil];

      [super dealloc];

  }

原文地址:https://www.cnblogs.com/cocoajin/p/3099035.html