我有一个由带有NSButtonCell单元格的列组成的NSTableView对象。我还有一个实现NSTableViewDataSource协议的类。设置单元格值的方法:
-( id )tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSButtonCell* cell = [[[NSButtonCell alloc] init] autorelease];
[cell setTitle:@"Title" ];
[cell setState:NSOnState];
return cell;
}结果,按钮的状态正确显示,但标题保持为空。如何设置按钮的标题?
发布于 2013-07-04 07:32:22
我解决了这个问题,将
NSButtonCell* cell = [[[NSButtonCell alloc] init] autorelease];至
NSButtonCell* cell = [tableColumn dataCell];https://stackoverflow.com/questions/17459558
复制相似问题