I checked the existing examples here in S.O, for my case which one do you think is better,
There are many textfields in one view and I want to validate them just when the user is editing that particular textfield, cause otherwise I have to validate them together when user press next on the screen than I have show all validation messages which I dont want to bother with. I want to validate the textfield in 2 different ways, if its a number input I want to validate it in a defined range e.g if number between between 5 and 1000 or if its a text then if the lenght of the text is in a defined range e.g between 2 and 10 characters. And the user must be able to enter any input out of range.
Which is better;
or something like this:
[textField addTarget:self action:@selector(validateField:) forControlEvents:UIControlEventEditingChanged];
And either the case how can I check on runtime that the number entered is in range and dont allow user to enter bigger or smaller numbers