1

I am developing an 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

LilMoke
  • 3,176
  • 7
  • 48
  • 88

2 Answers2

2

you need to call

[myTextField isFirstReponder]

This will tell you if myTextField has focus

There is also

[myTextField isEditing]
JFoulkes
  • 2,429
  • 1
  • 21
  • 24
0

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.

Krishna
  • 1,871
  • 14
  • 26
  • Yes, I get that, what I am really looking for is a way to find out which control has focus. I have a method that accepts a TextField and I want to pass the current text field to the function for processing. So I need to get a handle to the currently active object (TextField). Does that make sense? – LilMoke Mar 31 '11 at 15:30