What does “Controller Key” mean in Interface Builder > Inspector > Bindings?

后端 未结 4 1779
温柔的废话
温柔的废话 2021-01-03 00:33

I can\'t find in the Docs where they explain all those fields and what they mean. Especially \"Controller Key\" is not clear to me.

4条回答
  •  执笔经年
    2021-01-03 01:03

    The Controller Key pop-up menu is a way to help you discover what keys the controller (typically a NSArrayController, NSObjectController or a NSTreeController) presents.

    The best example is the selection key of NSArrayControllers, which contains the set of selected objects. What is confusing is the NSObjectController presents a 'selection' key too, although the controller can control only a single object (therefore the selection = the object).

    I agree that it is not clear at all. I personnally began to understand it when I bound my objects programmatically (i.e. using the bind:toObject:withKeyPath:options: method).

提交回复
热议问题