Saturday, 15 March 2014

cocoa - Override NSSearchField "Clear field" behavior -



cocoa - Override NSSearchField "Clear field" behavior -

i need override nssearchfield action happens when clear contents of field "clear" button.

the default fired selector private: _searchfieldcancel.

[update]

ok, i've found solution.

but how can prevent searchfield resigning first responder when clicking on "clear" button?

sorry, obvious enough, i'll post solution in case needs it:

[[[searchfield cell] cancelbuttoncell] setaction: @selector(desiredselector)]; [[[searchfield cell] cancelbuttoncell] settarget: desiredtarget];

cocoa override nscell nssearchfield

No comments:

Post a Comment