I have 3 UITextFileds on a view, and I want to apply logic in UITextFieldDelegate method only in two of them, how do I determine the UITextField that triggered the call backs?
Many thanks in Advance!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Usually, simple pointer comparison works, since you just want to check for object identity.
Alternatively, you could assign
.tags to the text field.The advantage is you don’t need to store the reference to
theIgnoredTextField, and the tag can be set from Interface Builder, but it relies on a recognizing magic number “37”.