Refreshing an NSTableView with some columns using bindings, others not..

  • Hi Everyone,

    I have a reasonably mixed NSTableView object.. I have some columns bound to my NSArrayController, which drives an NSCell with a Checkbox. I have other Columns which are driven by the traditional delegate calls, so that I can add some logic to change the text color, depending upon the state of the objects in the NSArray.

    What I am seeing, is that if I have some sort of activity that changes the state of the object, my checkbox is updated immediately by the NSArrayController. However, the delegate calls that are used to change the Text Color only occur if I click inside my UI.

    Is there a way to make this update along side the bindings? Or am I going to have to create an IBOutlet to my TableView, and do a [tableView reloadData] everywhere that I touch any object in my NSArrayController? Should I subclass my NSArrayController and have it issue this command?

    Thanks!

    bob.
  • On Jun 14, 2012, at 5:14 AM, Robert Monaghan wrote:

    > I have a reasonably mixed NSTableView object.. I have some columns bound to my NSArrayController, which drives an NSCell with a Checkbox. I have other Columns which are driven by the traditional delegate calls, so that I can add some logic to change the text color, depending upon the state of the objects in the NSArray.
    >
    > What I am seeing, is that if I have some sort of activity that changes the state of the object, my checkbox is updated immediately by the NSArrayController. However, the delegate calls that are used to change the Text Color only occur if I click inside my UI.
    >
    > Is there a way to make this update along side the bindings? Or am I going to have to create an IBOutlet to my TableView, and do a [tableView reloadData] everywhere that I touch any object in my NSArrayController? Should I subclass my NSArrayController and have it issue this command?

    You will need to make such a call, although -reloadDataForRowIndexes:columnIndexes: would be preferred and have fewer side effects. How or when, however, may be tricky. Close to the event that caused the data change would be most robust I imagine...

    HTH,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today