开发者

Determine which control has focus [duplicate]

This question already has answers here: Get the current first responder without using a private API (28 answers) Closed 9 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜