NSTextField's selector triggered on lost focus?
I'm using an NSTextField
as a search field, and it is bound to a selector. It is triggered when the return key is pressed (as expected), but it is also triggered when the field loses focus.
I don't want the selector to be triggered on lost focus. Is it possible to get around this be开发者_运维问答havior?
In Interface Builder or the XIB editor of Xcode 4, change the text field's Action property to Send on Enter Only.
See -sendsActionOnEndEditing in the NSCell documentation.
精彩评论