Cocoa核心数据自引用接口构建器问题

发布于 2024-08-05 13:07:16 字数 344 浏览 4 评论 0原文

我无法理解如何在界面生成器中进行以下操作。

我创建了一个核心数据模型类“Person”,它具有许多属性(名字、姓氏等)以及与其他人(朋友)的关系。

从概念上讲,这非常简单。然而,事实证明,弄清楚如何在 IB 中实现这一点是很棘手的。

我创建了一个界面,在窗口左侧有一个表格,列出了所有人员。右侧是用于输入人员详细信息的字段。

我想要一个较小的表格,在右侧显示“朋友”以及添加和删除按钮。单击“添加”按钮将启动一个带有搜索功能的小面板,用于过滤列表,以便您可以选择一个人,然后将其添加到“朋友”集中。

谁能给我一些建议,或者给我指出一个我能看到的类似这样的例子?

提前致谢, 马特

I'm having trouble understanding how to get the following working in interface builder.

I've created a Core Data model class "Person" that has a number of attributes (first name, surname, etc.) and a relationship to other persons (friends).

Conceptually this is very simple. However figuring out how to get this working in IB is proving tricky.

I've created an interface that has a table down the left side of the window listing all people. On the right side are the fields for inputting a persons details.

I'd like to have a smaller table that shows the "friends" on the right side together with add and remove buttons. Clicking the add button will launch a small panel with searching functionality for filtering the list down so that you can select one person who will then be added to the "friends" set.

Can anyone give me some suggestions or point me at an example I can see that does something like this?

Thanks in advance,
Matt

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琴流音 2024-08-12 13:07:16

假设您已经有一个容纳所有人的数组控制器,请创建第二个数组控制器,其内容数组绑定到第一个控制器的 selection.friends。将添加和删除按钮连接到该控制器的操作,并将 Friends 表的列绑定到其 arrangedObjects 属性。

Assuming you already have an array controller holding the all the people, make a second array controller whose content array is bound to the first controller's selection.friends. Connect the add and remove buttons to this controller's actions, and bind the friends table's column(s) to its arrangedObjects property.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文