简体   繁体   English

在OS X应用程序中填充NSTableView

[英]Populating NSTableView in OS X Application

I'm learning to develop OS X application. 我正在学习开发OS X应用程序。 I created a simple application that populates a table with itens. 我创建了一个简单的应用程序,该应用程序使用itens填充表。 I've been trying to populate my NSTableView with no success. 我一直试图填充我的NSTableView没有成功。 I don't know what I'm doing wrong. 我不知道我在做什么错。 I've got an array of 3 itens. 我有3个itens的数组。 The example is very simple. 这个例子很简单。

Here is the code on github: 这是github上的代码:

https://github.com/mcand/TableViewMacExample https://github.com/mcand/TableViewMacExample

Hope anyone can help me out. 希望任何人都能帮助我。

For use -(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row delegate method your cell must be the subclass of NSCell-class. 要使用-(id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row委托方法,您的单元格必须是NSCell-class的子类。 And NSTableView must be Cell-based as well. 而且NSTableView也必须基于单元。

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

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