how to catch on focus for NSTextField

how can i catch an event when a NSTextField gains focus or looses focus?

thanks

I had the same problem, but I solved it.

For the text field I set the “on action” and “on keyboard up” handler in the Interface Builder.

If the “on action” handler will be called, the text field lose it focus. If the “on keyboard up” handler is called, the text field has the focus.
This solution works for me.

Greetings, hoschy07.