Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.3 and later. |
Companion guide | |
Declared in | NSSearchField.h |
Related sample code |
An NSSearchField
object implements a text field control that is optimized for performing text-based searches. The control provides a customized text field for entering search data, a search button, a cancel button, and a pop-up icon menu for listing recent search strings and custom search categories.
An NSSearchField
object wraps an NSSearchFieldCell
object. Access to most search field attributes occurs through the cell, which provides a more comprehensive programmatic interface for manipulating the search field. You can use an NSSearchField
object though to manipulate some aspects of the search field. For additional information about search fields and how to manipulate them, see the NSSearchFieldCell class.
Returns the key under which the prior list of recent search strings has been archived.
- (NSString *)recentsAutosaveName
The autosave name, which is used as a key in the standard user defaults to save the recent searches. The default value is nil
, which causes searches not to be autosaved.
NSSearchField.h
Returns the list of recent search strings for the control.
- (NSArray *)recentSearches
An array of NSString
objects, each of which contains a search string either displayed in the search menu or from a recent autosave archive. If there have been no recent searches and no prior searches saved under an autosave name, this array may be empty.
NSSearchField.h
Sets the autosave name under which the receiver automatically archives the list of recent search strings.
- (void)setRecentsAutosaveName:(NSString *)name
The autosave name, which is used as a key in the standard user defaults to save the recent searches. If you specify nil
or an empty string for this parameter, no autosave name is set and searches are not autosaved.
NSSearchField.h
Sets the list of recent search strings to list in the pop-up icon menu of the receiver.
- (void)setRecentSearches:(NSArray *)searches
An array of NSString
objects containing the search strings.
You might use this method to set the recent list of searches from an archived copy.
NSSearchField.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)