• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTableView is not updated on [reloadData]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTableView is not updated on [reloadData]


  • Subject: NSTableView is not updated on [reloadData]
  • From: Alexander Bokovikov <email@hidden>
  • Date: Thu, 23 Jul 2009 21:21:30 +0600

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTableView is not updated on [reloadData]
      • From: David Blanton <email@hidden>
    • Re: NSTableView is not updated on [reloadData]
      • From: "I. Savant" <email@hidden>
  • Prev by Date: [iPhone] Zero opacity causes UIView to go numb
  • Next by Date: Re: NSTableView is not updated on [reloadData]
  • Previous by thread: Re: [iPhone] Zero opacity causes UIView to go numb (solved)
  • Next by thread: Re: NSTableView is not updated on [reloadData]
  • Index(es):
    • Date
    • Thread