是否有可能在Interface Builder中设计NSCell子类? [英] Is it possible to design NSCell subclasses in Interface Builder?

查看:152
本文介绍了是否有可能在Interface Builder中设计NSCell子类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图子类NSCell在NSTableView中使用。我想创建的单元格是相当复杂的,所以如果我可以在Interface Builder中设计它然后从一个nib加载NSCell非常有用。

I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib.

这是可能的?

推荐答案

这个线程中的一些答案已经关闭主题,因为他们在谈论Cocoa Touch,原来的问题是关于Cocoa - 这两个API是完全不同的Cocoa Touch使它很容易,因为UITableViewCell是一个视图子类。 NSCell不是,这是问题

Some answers in this thread have gone off topic because they're talking about Cocoa Touch, when the original question was about Cocoa - the 2 APIs are quite different in this regard and Cocoa Touch makes it easy because UITableViewCell is a view subclass. NSCell isn't, and that's the problem

有关信息,我不得不在NSOutlineView最近做一些非常相似的东西 - 基本上是一样的,但有点难因为你必须处理泄露/崩溃的级别。如果你对代码感兴趣,我在这里发布: http://www.stevestreeting.com/2010/08/08/cocoa-tip-using-custom-table-outline-cells-designed-in-ib/

For information, I had to do something very similar in NSOutlineView recently - which is basically the same, but a little harder if anything because you have to deal with disclosure / collapse of levels. If you're interested in the code, I posted about it here: http://www.stevestreeting.com/2010/08/08/cocoa-tip-using-custom-table-outline-cells-designed-in-ib/

HTH

这篇关于是否有可能在Interface Builder中设计NSCell子类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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