0

I have an NSTableView with two columns, First of them(With text cells) get it data through an NSArrayController.arrangedObjects.someKey bound to a Core Data entity. All is OK.

But second column is NSLevelIndicatorCell (Level Indocator Cell in IB's Object Library). I set maximum value through an NSArrayController (someKey.@count). And now want set the current value when some function run.

upd: Also I know how set current value in "tableView:willDisplayCell:forTableColumn:row:" delegate method. But this is not enough. How update current value of second column in some function? Send tableView's pointer(or rowPointer) to this Function, finding the required cell's pointer and use SetValue: method?

What is the alternative for tableView:objectValueForTableColumn:row:?

I do not want to change Entity and create any new numerical attributes like "the maximum number of subsections" or "total downloaded and processed at the moment."

The question: How do I make the tableview use its existing binding and set current value of NSLevelIndicatorCell?

Vladislav
  • 165
  • 1
  • 5
  • 15
  • Your question is not clear to me. NSLevelIndicatorCell is a custom cell? And you want to bind **what** using an @count keypath? – stevesliva May 13 '14 at 17:23
  • No, NSLevelIndicatorCell is not custom sell. So: In table I have one text column and one column with levelIndocator (Level Indicator Cell in IB's object library). For second column: I bind Max Value to NSArrayController(through property.@count). That's OK. And now want set Current value wenn some function run. Now I can set this current value only in "willDisplayCell" delegate method. That's not enough – Vladislav May 14 '14 at 07:53
  • Still not completely clear on what calls the function you're referring to-- whether it's called by a controller, or called by user click on something that is associated with a row. Regarding "the question"-- the max value binding is separate from the value binding, so you need another. You can do this programmatically in the delegate functions, but in IB you can bind the value to the cell with a keypath of `objectValue.[property]` where objectValue is the object assigned to the row by the array controller or datasource, and [property] is a property of that object. – stevesliva May 14 '14 at 17:14

0 Answers0