我有一个NSTableView
与复选框列和NSArrayController
。设置NSTableView内的复选框为“是”
NSTableView
绑定到NSArrayController
以显示其内容。 复选框列被绑定到imgArrayController.arrangedObjects.check1
。当程序启动时,数组是空的。我在一个循环中添加使用arrayController值是这样的:
[imgArrayController addObject:[NSDictionary dictionaryWithObjectsAndKeys:
[NSImage imageNamed: [NSString stringWithFormat:@"%@" ,fileName]], @"image",
[NSString stringWithFormat:@"%@" ,fileName], @"filename",
@"YES", @"check1",
nil]];
添加正确的行数,当它试图复选框设置为YES但是我得到一个错误。这是我得到的错误:
2013-02-03 19:11:46.357 Stockuploader[561:303] Error setting value for key path check1 of object {
} (from bound object <NSTableColumn: 0x100152280> identifier: check1): [<__NSDictionaryI 0x10010c190> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key check1.
有人能帮我理解我在做什么错吗?这些行出现在表格内,但它们都是空的。
谢谢!尝试... – sharkyenergy
谢谢,它不再给出错误,但复选框仍然没有设置。 – sharkyenergy
这是基于NSTableView视图还是基于单元格? – ipmcc