How we set 开发者_Go百科or get focus on any control in cocoa. like setfirstresponder
We have 2 control A and B, A is firstresponder After action I want to set focus ob B control
and also how we get focus on a particular control and how we notify that leave focus..... I need it in validation .... I want to force user to fill a textfield and then go to next field..something like this
Thanks Deepika
You should use NSWindow’s makeFirstResponder:
to change the current first responder. See the NSResponder
class reference for details on this.
For validation, the -becomeFirstResponder
and -resignFirstResponder
methods can be overridden.
More details in the documentation
精彩评论