NSArrayController + View based NSTableView binding to NSTextField
Asked Answered
E

1

14

I have a view based NSTableView. An array controller.

Set content of tableview to array controller's arrangedObjects. Set content of array controller to a NSMutableArray of a custom object.

Binding table cell view's NSTextField's value to the array controller with Controller key: arrangedObjects and Model key path: name

When program is running, the number of rows is correct, the contents in the arranged objects is correct but the textfield's string doesn't change? Tried binding the textfield and the and textfield cell.

Here is a sample: someone please tell me what I'm doing wrong. https://dl.dropboxusercontent.com/u/29574/random/nsarraycontroller%20viewbased%20tableview.zip

Equivoque answered 3/11, 2013 at 20:52 Comment(1)
Link is a 404. Can you update this with a screenshot?Rubescent
P
24

Following are the steps:

  1. Bind your array to array controller
  2. Select table view, go to Table Content widget and bind to ArrayController's arrangedObjects
  3. Select table view cell, go to value widget and bind to "Table Cell View" with the key path,whatever you have taken

Now Your table view will populate

Parabasis answered 4/11, 2013 at 7:33 Comment(1)
Thanks, I had to reread the the documents. To bind an NSTextField, the value should be binded to the Table Cell View and the modal key path should be objectValue.keypath instead of using arrangedObjectsEquivoque

© 2022 - 2024 — McMap. All rights reserved.