我有一个NSTableView,它显示一些代表我的自定义对象的信息。我没有使用绑定。将可编辑的NSTextFieldCell添加到我的NSTableView
通常,我创建自己的NSCell来显示数据,但是一旦我在NSTextFieldCell之后显示对象的字符串值,并让用户编辑它。
我可以使用下面的代码成功地添加NSTextFieldCell,但它不可编辑。
NSTextFieldCell *textField = [[NSTextFieldCell alloc] init];
[textField setFont:[NSFont fontWithName:@"Helvetica Bold" size:13]];
[textField setTextColor:[NSColor colorWithDeviceRed:0.1058823529 green:0.2117647059 blue:0.3294117647 alpha:1.0]];
[textField setStringValue:projectName];
[textField setEditable:YES];
[textField setBordered:NO];
[textField drawWithFrame:textRect inView:controlView];
[textField release];
有人可以帮助我吗?