Closed mrsnow-git closed 8 years ago
In my case,i use a custom textFiledCell and implement the textfield delegate methods.
I solve it for y project in other way:
on controller creation after creating the form I add
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:nil];
and have
- (void)textFieldTextDidChange:(NSNotification *)notification
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self updateFormDataState];
});
}
I've added dispatch_after
to be able to get in updateFormDataState
the updated values for all fields interested for me.
so now I can control some buttons states corresponding to fields text, for example disable Save button if some field are empty...
Is there options to get notifications about text field value changing ? to make something if get some value, for example.