I want to hide my button in my Popover class, whenever my bool value in the other class is false, but the Problem is i don't get the "TRUE" value.

My First Class

```
 -(void) hideButton{
        finished = _secondVC.finished;
        BOOL isRunning = !finished;
        if(isRunning){
        _deleteButton.hidden = YES;
        }else if(finished){
            _deleteButton.hidden = NO;
        }
    }

```

I call the method of hideButton in my ViewWillAppear function.

My Second Class

```
-(void) someAction{
  if(something){
  self.finished = YES;
}

```

EDIT:

Now, if i load the Popover and the NSNotification gets fired the button is enabled, but the Problem is, if i close and open the popover, my delete button is still disabled. 

My PopOver Class

```
  - (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if(syncFinished){
          _deleteButton.enabled = YES;
    }else if(!syncFinished){
        _deleteButton.enabled = NO;
    }
}

    - (void)viewDidLoad {
      [super viewDidLoad];
      [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(showButton)
                                                         name:@"syncFinish"
                                                       object:nil];
     }

    - (void) showButton{
     syncFinished = YES;
      _deleteButton.enabled = YES;
     }

```

My Second Class

```
-(void) someAction{
  if(something){
  [[NSNotificationCenter defaultCenter] postNotificationName:@"syncFinish"
                                                        object:self];
}

```