tags:

views:

70

answers:

1

How can i get a notification if a NSView gets the key focus?

I expected a method like "windowDidBecomeKey" from NSWindow but either i'm blind or there is nothing like this is NSView.

+2  A: 

The key view, when there is one, is the first responder. So, implement the becomeFirstResponder method in your view, and either handle that there or post a notification for your controller to listen for.

Peter Hosey