Search code examples
cocoacocoa-bindingsnsarraycontroller

Binding an NSArrayController at runtime


I need to bind an NSArrayController's content set at runtime. The content set is the "many" part of a one:many relation between two NSManagedObject classes, for which the one part is known at runtime.

The method to use is (I think):

[[self referencesController] bind: <content set> toObject: [self representedObject] withKeyPath: @"references" options: nil]

In the above [self referencesController] is the NSArrayController, [self representedObject] is the 1 part of the relationship and @"references" is the many part of the relationship.

My question is to what property of NSArrayController do I make the binding, hence what needs to be entered for content set?


Solution

  • I think what you're looking for is @"contentArray".