正在进行NSTableView问题 [英] Ongoing NSTableView problems

查看:186
本文介绍了正在进行NSTableView问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写我的第一个Cocoa / OSX应用程序。我一直有一个NSTableView派生类的问题。问题是在包含NSView没有表 - 表是不可见的。
我以前在粘贴我的代码,但未显示NSTableView

I am writing my first Cocoa/OSX app. I have been having problems with an NSTableView derived class. The problems is that there is no table in the containing NSView - the table is not visible. I previously pasted my code at NSTableView is not being displayed

如果你知道NSTableView很好,它可以帮助,这将非常有帮助。

If you know NSTableView well and it could assist, it would greatly help. I have spent a couple of days on this, with no luck.

其他详情:


  1. NSLog显示NSTableView子类init()被调用一次。这可能是好的。方法numberOfRowsInTableView()被调用多次。我不知道这是好还是坏。方法tableView:objectValueForTableColumn:row:从未被调用。在初始化TableView之后调用NSView的drawRect()方法。然而,注释掉[super drawRect:dirtyRect];

  2. 请注意,我使用与[也] NSTableViewDataSource相同的NSTableView子类。我明白这不是常见的模式,但我不明白为什么这不能工作。如果有一个逻辑的解释,请告诉我的方法是不可行的。

  3. 我不使用,不想使用InterfaceBuilder。

感谢您花时间阅读我的问题。

Thank you for taking time to read my question.

推荐答案

与解决方案。有关更多信息,请参阅引用页面,如果感兴趣。谢谢。

I managed to come up with the solution. See the referred page for more information, if interested. Thanks.

BTW,我看过的最好的NSTableView教程 - 一个允许我做我需要的是在 http://www.knowstack.com/nstableview_fromcode/

BTW, the best NSTableView tutorial which I have seen - one that allowed me do what I needed is at: http://www.knowstack.com/nstableview_fromcode/

这篇关于正在进行NSTableView问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆