Hello there: I have in essence a master-detail application with one master view-based NSTable view and two detail views. My master NSTable loads and displays data from a Managed Object Context correctly. One of my detail views should load the image of the object in selected table row. But here is my problem that no one else on the Internet seems to have:

My "selection" object isn't changing. I did bind the the value of image view on my detail view to the Array Controller, and controller key is: "selection", model key is "image". The image view only loads the first object's image in the table, and if I click/select on other rows, the image isn't changing. So it seems like "selection" object is always the first object. Since this is all done in Interface Builder, I don't have any code to show, sorry.

Does anyone know what is going on? Why is the "selection" object always the first in the table? Thank you!

有帮助吗?

解决方案

You need to bind the NSTableView’s selection to the NSArrayController’s, like so:

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top