Using makeFirstResponder

I have a textField that has some text shown using placeHolder. When I run the app, the textField becomes the firstResponder and no grayed out text is displayed, So, I made the property theWindow as the first responder using theWindow’s makeFirstResponder_(me) and placed it in on applicationwillFinishLaunching_(eNotification) delegate with proper IB connection. Now, when the app runs, the text from the placeHolder is displayed, but no text can be entered as it has become un-editable.

How can I accomplish the above while still be able to enter text.


Placeholder text disappears when a text frame becomes first responder under all versions of the OS except 10.8 – there’s nothing you can do about it.

Thank you Shane.


I resolved it by looking closer into the NSTextField’s inspector’s attributes. It turned out, there is a checkbox that says “refuses first responder”.

or in code:
textField’s refusesFirstresponder_(true)

I should note that I have other objects in the app and not only a textField and a Window.



Does anyone know how to check for which object is a first responder? I looked at NSResponder class, but wasn’t able to determine if any of the listed methods can produce the answer.


you can get and set first responder in NSWindow