The programmatic interface for text fields that are used for text-based searches.
- macOS 10.3+
NSSearch class defines the programmatic interface for text fields that are optimized for text-based searches. An
NSSearch object is “wrapped” by an
NSSearch control object, which directly inherits from the
NSText class. The search field implemented by these classes presents a standard user interface for searches, including a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories.
When the user types and then pauses, the cell’s action message is sent to its target. You can query the cell’s string value for the current text to search for. Do not rely on the sender of the action to be an
NSMenu object because the menu may change. If you need to change the menu, modify the search menu template and update the value in the