Condition: I have an NSArrayController in an NSViewController properly bound to a Core Data entity. I have added buttons to add and delete rows (see pic) that are properly connected to the array controller. But, when I add a row, instead of getting the bound variable as the table cell contents, I get the title of the cell.
Information: In the image provided below you see a view controller with a table view and a text field. The text field value is bound to the Array Controller.selection.myvariable, and it properly shows the value of myvariable. The table view column is bound to Array Controller.arrangedObjects.myvalue, but it shows the cell.title ("New Table Cell") rather than myvalue.
Question: What have I missed to get the proper value into the cell. I have not implemented Table View Delegate or Data Source methods. My understanding is that the Cocoa Binding eliminates the needs for such "glue". Why does the textfield work but not the table column? Thanks for helping if you are able.
答案 0 :(得分:0)
在Xcode 9.1中,您不能将tableview列绑定到属性,只需将它绑定到Controller Ket到arrangeObjects,并将模型键路径留空。然后将列的文本字段单元格绑定到模型键路径objectValue.yourvar。