title: Add observer for a boolean value
body: <p>I am trying to add an observer to an object and trigger it by changing it boolean value.</p>
  
  <p>Code:
  Add Observer:</p>
  
  <pre><code>[unitsCellViewController.cell addObserver:self forKeyPath:@"unit" options:0 context:nil];
  </code></pre>
  
  <p>In the object, when the textfield is changing, I will change the boolean value and try to trigger the notification:</p>
  
  <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
  {
      if ([string length] != 0)
      {
          NSRange match = [@"0123456789" rangeOfString:string];
          if (match.location == NSNotFound) {
              return NO;
          }
      }
  
      [self willChangeValueForKey:@"unit"];
      self.on = !on;
      [self didChangeValueForKey:@"unit"];
  
      return YES;
  }
  </code></pre>
  
  <p>but this is not working, the value did get changed, but the observer is not triggered.
  Am I doing this correctly? If not, how can I trigger the event when the textfield is changed?</p>