iphone - How to compare the instance of UITextField -


I have 3 UITKFIELD on one view, and I want to apply the argument only in two UITextFieldDelegate method, how do I Determining the UIT ext field that triggers the call back?

Many thanks in advance! Usually, simple index comparison works because you want to check object identification.

- (BOOL) textFieldShouldReturn: (UITextField *) textField {if (textField! = The ignoredTextField) {...

Alternatively, .tag s can be specified in the text field.

  - (BOOL) textFieldShouldReturn: (UITextField *) TextField {if (textField.tag! = 37) {...  

> The archive of the ignoredTextField is not required to be stored, and the tag can be set to the interface builder, but it depends on a magic identification number "37".


Comments