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];

  }

posted @ 2013-05-25 16:27  cocoajin  阅读(366)  评论(0编辑  收藏  举报