NSArrayController 的绑定在哪里声明的?

发布于 2024-12-21 23:05:03 字数 663 浏览 2 评论 0原文

绑定 NSArrayController 时,我在“控制器内容”选项卡

  • “内容数组”“
  • 用于多重选择
  • 内容对象
  • 内容集的

内容数组”下看到以下可用绑定“但是,我在 Apple 参考NSArrayController,也不在实际的 NSArrayController.h 本身内。他们从哪里来?它们与 arrangedObject 属性有何不同?

下面的屏幕截图

在此处输入图像描述

When binding a NSArrayController, I see the following bindings available under controller content tab

  • Content Array
  • Content Array for Multiple Selection
  • Content Object
  • Content Set

However, I couldn't find those options inside the Apple reference for NSArrayController, nor inside the actual NSArrayController.h itself. Where do they come from? And how do they differ from the arrangedObject property?

Screenshot Below

enter image description here

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

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

发布评论

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

评论(1

韶华倾负 2024-12-28 23:05:03

它们记录Cocoa Bindings Reference,并且它们没有在任何头文件中公开声明。 Xcode 对它们的了解已融入 Xcode 中,可能在它附带的某个插件中。

它们与 arrangedObject 属性有何不同?

arrangedObjects(复数)是一个输出。数组控制器排列其内容对象,其结果就是其排列的对象。

绑定是输入:

  • contentArray 是主要的,因为它是一个数组控制器。
  • contentSet 是绑定到 Core Data 多对多关系(即集合)的替代方法。我不确定它是否适用于有序集;当集合未排序时,arrangeObjects: 使用的顺序以及 arrangedObjects 中的清单由数组控制器的排序描述符确定。
  • contentArrayForMultipleSelection,通常不需要。 Cocoa Bindings Reference 中对您确实需要它的情况进行了很好的描述。
  • 正如 CBR 所说,contentObject 是另一个数组控制器。再次,请参阅文档以了解何时需要它的描述。

内容来自一个(或多个)内容绑定,由 arrangeObjects: 排列(根据数组控制器可能具有的任何排序描述符),然后按 下指定的顺序可用安排对象

They're documented in the Cocoa Bindings Reference, and they're not publicly declared in any header file. Xcode's knowledge of them is baked into Xcode, probably in some plug-in somewhere that comes with it.

And how do they differ from the arrangedObject property?

arrangedObjects (plural) is an output. The array controller arranges its content objects, and the result of that is its arranged objects.

The bindings are inputs:

  • contentArray is the main one, since it is an array controller.
  • contentSet is an alternative for binding to Core Data to-many relationships, which are sets. I'm not sure whether it works with ordered sets; when the set isn't ordered, the order used by arrangeObjects: and manifest in arrangedObjects is determined by the array controller's sort descriptors.
  • contentArrayForMultipleSelection, you don't normally need. The case in which you do need it is described quite well in the Cocoa Bindings Reference.
  • contentObject is, as the CBR says, another array controller. Again, see the docs for its description of when you'd need it.

Content comes from one (or more) of the content bindings, is arranged (according to any sort descriptors the array controller may have) by arrangeObjects:, and is then available in the appointed order under arrangedObjects.

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