Hi, All,

So, I'm continuing :)
I've connected my NSTableView with AppController (in IB) setting AppController, as NSTableView's datasource. Then I've added a couple of methods to the AppController to implement NSTableDataSource protocol:

- (int)numberOfRowsInTableView:(NSTableView *)tableView;

- (id)tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
                        row:(int)row;

Also I have a timer in my app, which should recalculate something from time to time and, as a result of this procedure, table row count (as well as values) should be updated. onTimer: method is like this one:

- (void)onTimer:(NSTimer*)timer {
//
// here we do some actions, leading to actual changes in the table content.
//
        [myTable reloadData];
}

It all is correct for the first look. Isn't it? Now what is happening. numberOfRowsInTableView: is called only once, yet before AppController's awakeFromNib is called. At that moment nothing yet is initialized (initialization goes in awakeFromNib), so numberOfRowsInTableView: returns zero.

Nothing happens when [myTable reloadData] is called within onTimer: procedure. None of delegated methods are called, so my table is always empty, though new data (of nonzero length) are created.

So, my question is - how to make table view to change its row count and update the data?

Thanks.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to