how to use kvo to observer textfiled's text change?
<p>the demo is very simple </p>

<pre><code>// add a textField to viewController's view 
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(0, 30, 375, 40)];

self.textField = textField;

textField.placeholder = @"Please input text";

// add observer for textField's attribute "text"
[textField addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];

[self.view addSubview:textField];
</code></pre>

<p>and then implement the method:</p>

<pre><code>- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary&lt;NSString *,id&gt; *)change context:(void *)context {


NSLog(@"----  text changed"); 
}
</code></pre>

<p>at the dealloc method :</p>

<pre><code>- (void)dealloc {

[_textField removeObserver:self forKeyPath:@"text"];
}
</code></pre>

<p>but when i input text , the method  observeValueForKeyPath:ofObject:change:context: do not execute</p>

<p>i don't know why</p>