我有一个表格视图,在该表格视图上选择一行的一列将调用重写方法
- (void)selectWithFrame:(NSRect)inCellFrame inView:(NSView *)inControlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength {
// here do some text positioning
[super selectWithFrame:inCellFrame inView:inControlView editor:textObj delegate:anObject start:selStart length:selLength];
}
我还返回单元格的字段编辑器,如下所示:
- (NSTextView *)fieldEditorForView:(NSView *)inControlView {
MYTextView* fieldEditor = [[[MYTextView alloc] initWithFrame:NSZeroRect] autorelease];
return fieldEditor;
}
选择单元格时,单元格内的文本会更改其属性。就像,字体大小、字体、字体样式等会相应地发生变化,当文本处于选择模式时,我似乎无法控制它。即使在选择之后我也不想更改其字体属性如何避免文本属性的这种更改?