How can I reset a cocoa NSSearchField programmatically?
I figured it out. The following code works:
[searchField setStringValue:@""]; [[[searchField cell] cancelButtonCell] performClick:self];
I figured it out. The following code works:
[searchField setStringValue:@""];
[[[searchField cell] cancelButtonCell] performClick:self];
[[[searchField cell] cancelButtonCell] performClick:self];
might work, but it really seems like there should be a "proper" solution. Is your table view actually bound to the searchField's value, or is it bound to some intermediate object that is not getting updated when you set the searchField's contents to the empty string programatically (but which is getting updated when you type because of the way the bindings are set up in the nib)?