所以我有一个带有动态NSTableColumns的NSTableView。这些列应该从NSArrayController的arrangedObject中获取数据。
因为一切都是动态的,所以我不能真正使用接口构建器来绑定值。如何以编程方式完成此操作?
我试过这个:
NSTableColumn *newColumn = [[NSTableColumn alloc]initWithIdentifier:aKey];
[newColumn.value bind:@"value" toObject:arrayController.arrangedObjects withKeyPath:aKey options:nil];发布于 2012-10-07 05:14:33
好吧,我想通了..。
NSString *akey = @"somekey";
NSString *keypath = [NSString stringWithFormat:@"arrangedObjects.%@",akey];
[newColumn bind:@"value" toObject:arrayController withKeyPath:keypath options:nil];https://stackoverflow.com/questions/12763669
复制相似问题