NSSearchField allows you to uncheck "search immediately" in the Interace Builder attributes editor. Wh开发者_Go百科en this is the case, the target action will not be invoked until a short time after the user stops typing.
- Exactly how long is this delay?
- Is this delay configurable? If so how?
I don't believe the delay is configurable. What you could do is set the text field to search immediately but then override -textDidChange:
in a subclass of NSSearchFieldCell
.
You could then control the search delay using an NSTimer
or some other method and call super's implementation of -textDidChange:
when you want to trigger the search.
精彩评论