문제

When having a NSSearchField in a toolbar, it automatically becomes first responder when pressing TAB key in the window. How can I prevent that? I.e. to get the search field to refuse first responder?

도움이 되었습니까?

해결책

If using Xcode 4.3.2, open up the XIB file, click the toolbar item twice to select the NSSearchField (one click selects NSToolbarItem). In the Attributes inspector, tick the "Refuses First Responder" checkbox and Bob's your uncle.

The trick here is that NSToolbarItem cannot refuse the first responder in general. However, the NSSearchField (whose ancestor is the NSToolbarItem) can refuse.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top