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.
This is how I solve this problem:
NSTextFieldCell
;- (void)drawWithFrame:(NSRect)cellFrame
, - (void)drawInteriorWithFrame:
(if need) method(s) of NSCell
and put all drawing code you need to those methods. Don't forget to call super
implementation;Class
field of NSTextFieldCell
in Interface Builder
to your subclass; border
in .xib
file to (I don't know name of this border);Draw Background
;