views:

12

answers:

0

Basically I have two combo boxes whose content are bound to two NSDictionaryControllers. However the content of the second combo box depends on the selection of the first. How can I accomplish this in interface builder taking advantage of the fact that my objects implement KVO protocol. It seems that the bookComboBox selection changing does not impose a selection on the BookDictionaryController. I checked this by looking at [BookDictionaryController selection] inside the selectionDidChange delegate method of the bookComboBox, and there was no selection.

The object model looks like this:

subject = top level object that has a dictionary called books
books = dictionary of book objects, with the book title as the key.
book = book object with a title property and a dictionary called chapters
chapters = dictionary of Chapter objects, with the chapter name as the key
chapter = a chapter object.

In interface builder I did this:

BookDictionaryController content{
bound to : applicationController
model key path: subject.chapters
}

bookComboBox content{
bound to: BookDictionaryController
controller key: arrangedObjects
model key path: key
}//same for content values

ChapterDictionaryController{
bound to: BookDictionaryController
controller key: selection
model key path: value.chapters
}

chapterComboBox content{
bound to: ChapterDictionaryController
controller key: arrangedObjects
model key path: key
}//same for content values