Updating NSTableView

Discussion in 'Mac Programming' started by satyam90, Aug 5, 2008.

  1. satyam90 macrumors regular


    Jul 30, 2007
    Bangalore, India
    I am using Obj C with Cocoa Framework.
    I am using NSTableView in my application. I have bind the columns to an array controller. But initially when ever I am adding objects to the array controller it's not updating the table view. When I close the window and click the icon in the dock, it will open the window as well as window is refreshed will the details. Why is it happening like that. How can I call manual refresh of the window. I tried using NSWindow's "update" as well as NSApplication's "updateWindows" but getting error that selector was not recognized.
    Please help me in sorting out this problem.
  2. HerQ macrumors newbie

    Jun 11, 2008
    The Netherlands
    When it's bound it should refresh automatically. When you're not using KVC for refreshing the data, you'll have to let the NSTableView know that the NSArrayController is refreshing it's data. You can do so with:

    [self willChangeValueForKey:@"keyname"];
    //Update code
    [self didChangeValueForKey:@"keyname"];

Share This Page