cocoa绑定嵌套在 nscollectionviewitem 中的 nstableview

发布于 2024-10-16 19:11:40 字数 690 浏览 2 评论 0原文

我有一个正在运行的核心数据应用程序,我想显示一些实体的表示。我已经使用 Interface Builder“Core Data Entity Assistant”设置了一个 NSCollectionView 来设置集合(在 MyDocument.xib 中生成了一个视图),并且可以访问简单的 returnedObject.attributes 以及简单的关系属性。

我的问题是多对多关系,我想将其显示为嵌套在集合项中的表。我已经为 NSTableColumns 尝试了不同的 shownObject 键路径组合,但没有找出正确的可可绑定咒语来深入数据。

EntityA (reprensented in the Collection) <WORKS>
. EntityB (simple relationship) <WORKS with representedObject.relationship.attr>
.. EntityC (to-many-relationsip of EntityB) <how to get there???>

截至目前,99% 的代码是通过核心数据模型和 Interface Builder 生成的。我并不反对对某些东西进行子类化以获得所需的行为,但我更愿意让事情尽可能自动化——特别是因为这应该“只适用于”原样的类。使用 Xcode 3.2.5 —— 如果有人告诉我那里的绑定更明确,我不介意跳到 4GM。

I have a working Core Data app and I want to display a representation for some of the Entities. I have set up an NSCollectionView with the Interface Builder "Core Data Entity Assistant" to setup the collection (generated a View in the MyDocument.xib), and can access simple representedObject.attributes, as well as simple relationship attributes.

my problem is with the to-many Relationships, which I would like to display as tables nested in the Collection item. I have tried different representedObject keypath combinations for the NSTableColumns, but did not figure out the correct cocoa binding incantation to drill down the data.

EntityA (reprensented in the Collection) <WORKS>
. EntityB (simple relationship) <WORKS with representedObject.relationship.attr>
.. EntityC (to-many-relationsip of EntityB) <how to get there???>

as of right now 99% of the code is generated through the Core Data Model and by Interface Builder. I am not opposed to subclassing something to get the desired behavior but I would prefer to keep things as automated as possible -- especially since this should "just work" with the as-is classes. using Xcode 3.2.5 -- I don't mind jumping to 4GM if someone tells me the bindings are more explicit there.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文