NSTextField placeholder text doesn't show unless editing

indragie picture indragie · Apr 2, 2011 · Viewed 10.9k times · Source

I set the placeholder text of my NSTextField in Interface Builder, but the placeholder text doesn't show until I click inside the text field to edit it.

Answer

Johann Dirdal picture Johann Dirdal · Apr 2, 2011

Have you tried setting the placeholder through code? for example something like this:

    [[textField cell] setPlaceholderString:@"hello"];