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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The key view, when there is one, is the first responder. So, implement the
becomeFirstRespondermethod in your view, and either handle that there or post a notification for your controller to listen for.