I was looking for the same thing for multi-line NSTextField the other day, with no luck, so I ended up using a set of buttons without a border and switching with a small image. very close to NSTextField (not on it)
and
- (IBAction)clearTextViewTex:(id)sender{
[textField performSelector:@selector(selectAll:)];
[textField performSelector:@selector(delete:)];
}
Executing this method also retained undo functions, without having to write any NSUndoManager content.
source
share