2
votes

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 button 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.

1

1 Answers

1
votes

Try changing the first responder after hiding it.

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