So, I instantiate an NSWindowController, which in turn instantiates a .xib. The xib has NSArrayControllers, which populate their array with NSManagedObjects. The window controller has an (mutable) array property, which serves as datasource for an NSTableView in the .xib. I have the NSTableViewDataSource (and delegate) methods implemented. So far, so good..
The window controller has outlets to the array controllers in the xib. When I try to fill the array (with dictionaries, the keys of the objects correspond with the column identifiers of the table, no problem there), I am having a really hard time getting the content of the array controllers.
Somehow, I am not getting the array controllers to fetch their managed objects in time. When I get the array (arrangedObjects:) of the array controllers, to create dictionaries with, for the array property that fills the table, I get nothing.
Am I not doing things in the correct order? Could someone point me to a good explanation how and when IB-objects (such as array controllers) fetch their data? Should I move the table populating code to a (subclassed) object in the interface builder? I have tried manipulating the table's array in the window controller's init, awakeFromNib, and windowDidLoad methods. Although this seems to work, I doubt I'd have to put the table's array object adding in the window's makeKeyAndOrderFront method.