views:

26

answers:

0

Hello, my question relates to Interface Builder and an IKImageBrowserView not implementing bindings as I would expect.

I have a fairly long key path to get to an NSArrayController, the contents of which I want to display in the IKImageBrowserView.

This is the key path I am binding an NSTextField's Display Pattern binding to: currentOrder.imagesArray.unvalidatedImages.arrangedObjects.@count of the AppDelegate. This works fine and gives me the number of unvalidated items in the array of images belonging to the current order, which is what it is supposed to.

When I attempt to bind the following key path to the IKImageBrowserView's content: currentOrder.imagesArray.unvalidatedImages.arrangedObjects of the AppDelegate, Interface Builder gives no error but instead acts as if I hadn't entered anything. When I click back to the inspector, the bindings key path is blank again.

It does however log the following to the Console: Ignoring exception related to working with bindings: NSUnknownKeyException, [<NSCustomObject> addObserver:<IKImageBrowserView ...> forKeyPath:@"currentOrder.imagesArray.unvalidatedImages.arrangedObjects" ...] was sent to an object that is not KVC-compliant for the "currentOrder" property.

My AppDelegate implements currentOrder as an @property retained and all sub-keys are also @properties. I can be sure that these properties are KVC-okay because the NSTextField above is able to read changes without a problem. Interestingly enough the IKImageBrowserView's selectionIndexes is able to bind to ...unvalidatedImages.selectionIndexes, it's only the content that can't.

I have implemented a workaround whereby I have placed an NSArrayController in my nib file and bound the Content Array to ...arrangedObjects then bound the IKImageBrowserView to the array controller but would be very happy to have a neater solution, or at least to know whether I am doing anything wrong.

Thank you!