Determine which control has focus [duplicate]
I am developing an 开发者_JAVA百科app for iPod/iPhone and I am trying to determine which control has focus. I am new to XCode so my terminology may be incorrect, but I am looking for the object (control) where the user is currently typing.
Hope someone can help!!
Thanks, Tony
you need to call
[myTextField isFirstReponder]
This will tell you if myTextField has focus
There is also
[myTextField isEditing]
If you are looking for just doing something on change of text in a control, you just need to wire up an IBAction to the control's change event and then everytime the text changes, your IBAction method will be called.
精彩评论