iphone - Where should validation code go for UITextField? -


I have to verify some user entries. Was I thinking of adding it to this event? Also, how can I see if we are in a special entry zone?

  - (zero) textFieldDidEndEditing: (UITextField *) textField  

You should create an IBOutlet in the text field of all your views and compare them with the 'textField' parameter.

To confirm the content of TextField, it would be better to use this delegate method:

Prefix - TextFieldShouldEndEditing: (UITextField *) textField

From the document:

Normally, you will send the text field back to yes to resign the respondent status before this method. You can not return again, however, in those cases where your representatives find illegal material in the text area. After not returning, you can prevent the user from switching to another control until the text field contains a valid value.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

kernel - How to create a "Block device" in Windows -