Search code examples
cocoamacosinterface-buildernssearchfield

NSSearchField: how long is the search delay? Is it configurable?


NSSearchField allows you to uncheck "search immediately" in the Interace Builder attributes editor. When this is the case, the target action will not be invoked until a short time after the user stops typing.

  1. Exactly how long is this delay?
  2. Is this delay configurable? If so how?

Solution

  • 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.