NSArrayController 的绑定在哪里声明的?
绑定 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们记录在 Cocoa Bindings Reference,并且它们没有在任何头文件中公开声明。 Xcode 对它们的了解已融入 Xcode 中,可能在它附带的某个插件中。
arrangedObjects
(复数)是一个输出。数组控制器排列其内容对象,其结果就是其排列的对象。绑定是输入:
contentArray
是主要的,因为它是一个数组控制器。contentSet
是绑定到 Core Data 多对多关系(即集合)的替代方法。我不确定它是否适用于有序集;当集合未排序时,arrangeObjects:
使用的顺序以及arrangedObjects
中的清单由数组控制器的排序描述符确定。contentArrayForMultipleSelection
,通常不需要。 Cocoa Bindings Reference 中对您确实需要它的情况进行了很好的描述。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.
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 byarrangeObjects:
and manifest inarrangedObjects
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 underarrangedObjects
.