自定义层次结构视图——是否 NSTreeController?
我有一个想要在大纲视图和自定义视图中(同时)显示的内容的层次结构。有点类似于 CH 中的 Buck 和 Yacktman(可可设计模式)示例。 29,但用大纲而不是表格。我很可能还会提供详细视图。
我之前只使用过 NSTreeController 和单个大纲视图。现在我发现“arrangedObjects”并不是人们想要的那样。还发现(出于某种原因)所有“canInsert”及其亲属的值都为“否”(出于某种原因我找不到(或通过谷歌找到))。到目前为止,看来 NSTreeController 对协调我的两个视图几乎没有帮助。 (顺便说一句,过去我总是让添加、删除功能直接在模型上工作。)
在我看来,现在回到使用数据源方法并使用架构会更好、更简单更像 Buck 和 Yacktman 的图 29.4(第 357 页),带有手工制作的中介控制器。
I have a hierarchy of stuff I want to display (at the same time) in both outline view and a custom view. Sort of analagous to the Buck and Yacktman (Cocoa Design Patterns) example in CH. 29, but with Outline instead of Table. I'll most likely have a detail view available also.
I've only used NSTreeController with a single outline view before. Now I have found that "arrangedObjects" aren't what one would like them to be. Also found that (for some reason) all the 'canInsert' and it's relatives have value NO (for some reason I can't find (or find with google)). So so far, it appears that NSTreeController is little help in coordinating my two views. (By the way, I've always had my add, delete functions work directly on the model in the past.)
it seems to me now it would be better and simpler to go back to using a data source approach, and use an architecture more like Buck and Yacktman's figure 29.4 (page 357) with a handmade mediating controller.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题已经存在很长一段时间了,没有人接受。
只是为了结束这个:
我已经尝试过 NSTreeController 和数据源版本。目前,我坚持使用数据源,因为它似乎给了我更大的灵活性。
——我正在开发的程序非常具有实验性,尝试了许多不同的事情。第二个目标是制作一个我觉得有用的应用程序,并且三重:-)也许制作一个用于分发的清理版本。
This has been hanging around for quite a while with no takers.
Just to close this out:
I've tried both NSTreeController and data source versions. Currently, I'm sticking with data source, since it seems to give me more flexibility.
-- The program I'm working on has been very much experimental, trying a number of different things. A secondary goal is to make an application I will find useful, and ternaryily :-) maybe make a cleaned up version for distribution.