简体   繁体   English

通过[NSTableColumn dataCellForRow]检索NSCell数据时出现问题

[英]Problem retrieving NSCell data via [NSTableColumn dataCellForRow]

I am trying to retrieve a specific NSCell data from an NSTableView through [NSTableColumn dataCellForRow] but every time it shows different value for same row and same column. 我试图通过[NSTableColumn dataCellForRow]NSTableView检索特定的NSCell数据,但是每次它为相同的行和相同的列显示不同的值时。 The data source remains the same at all time. 数据源始终保持不变。 The NSTableView is bound to an NSArrayController .Please if anyone can suggest a better way to do it correctly. NSTableView绑定到NSArrayController 。如果有人可以提出一种更好的方法来正确执行此操作。 And I don't want to implement those delegate methods. 而且我不想实现那些委托方法。 Let me know if you require more information. 如果您需要更多信息,请告诉我。

Regards 问候

Well, this is not a good idea to get data from a cell. 好吧,这不是从单元格获取数据的好主意。 Cells represent View concept in Model-View-Controller paradigm. 单元格代表“模型-视图-控制器”范例中的视图概念。 You should be able to access all the data that a cell can access, so get it from the primary data source. 您应该能够访问单元可以访问的所有数据,因此可以从主数据源获取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM