开发者

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.

NSTextField's selector triggered on lost focus?


See -sendsActionOnEndEditing in the NSCell documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜