开发者

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

开发者 https://www.devze.com 2023-02-21 18:47 出处:网络
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

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.

  1. Exactly how long is this delay?
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消