- 設置光標顏色
#import "MYTextField.h"
@implementation MYTextField
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
[(NSTextView*)[self currentEditor] setInsertionPointColor:[NSColor blueColor]];
}
@end
-
去掉選中時藍色邊框
- 設置stringValue時如果為nil纠拔,會 Crash闪檬,要做判空處理.
textField.stringValue = newAppPath ? newAppPath : @"";