开发者

NSTextField and hidden property

I have an NSTextField that I hide when the user presses a button. I hide the text field using [textField setHidden:YES]; The problem is that is the user is typing in the text field (i.e. the text field is first responder) and the user presses the return key (which is the key equivalent for the butt开发者_如何转开发on that hides the text field) the user can keep typing in the text field even though its not visible. How do I correctly remove a text field without actually deallocating it?

Thanks.


Try changing the first responder after hiding it.

[[textField window] makeFirstResponder:[textField nextResponder]];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜