开发者

No action sent when NSSearchField is emptied?

开发者 https://www.devze.com 2023-04-02 06:08 出处:网络
I\'ve set up an NSSearchField i开发者_如何学Gon a toolbar and connected an action in Interface Builder. This action gets called every time I enter some text, but not when I click the small cross to em

I've set up an NSSearchField i开发者_如何学Gon a toolbar and connected an action in Interface Builder. This action gets called every time I enter some text, but not when I click the small cross to empty it or I somehow delete the text I just entered. Is this a bug or is it fixable?


Well, I figured out it actually works. My problem was that 1) I used the search string from the search field to filter some strings and searching a string for an empty string (@"") apparently returns no result 2) when I tried to log the search string using NSLog(@"%@",searchString) I got some output only with a non-empty string, while NSLog(@"sometexthere %@",searchString) seems to work!

0

精彩评论

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