NSTextField: end editing when user clicks outside of the text field
I have an NSTextField that I'm setting editable depending on a user action. I'd like to end editing when the user clicks anywhere outside of the text field inside the window. Seems simple, but I could not get this to work. I implemented controlTextDidEndEditing and textDidEndEditing , but no luck, especially when I click on a user interface element that does not accept the first responder status. Every NSEvent is pass through NSWindow's sendEvent: method. You can create a custom NSWindow and override the sendEvent: method. If there is a mouse down event, broadcast it by the