• 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
Re: Problem on reload data source of a table view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem on reload data source of a table view


  • Subject: Re: Problem on reload data source of a table view
  • From: JArod Wen <email@hidden>
  • Date: Tue, 15 Jul 2008 13:17:23 -0400

Hi Corbin,

Thanks for fast reply! Just as Jens said, I have checked the table and I am sure that it is not nil:

Printing description of dataTable:
<NSTableView: 0x7d85b80>
(gdb) continue

I also debugged the table source and I can get the count correctly(not zero)

2008-07-15 13:05:23.683 Roboplasm[1892:813] [[[[appController tableController] tableSource] items] count] = 2
(gdb) continue


However, the method -numberOfRowsInTableView has never been called since I added a NSLog there:

- (int)numberOfRowsInTableView:(NSTableView *)tableView {
NSLog(@"Method -numberOfRowsInTableView is called with count %d.", [items count]);
return [items count];
}


since the log message has never been found. The same problem happens for -tableView:objectValueForTableColumn:row:. Could you help me to figure out what the problem is? Thanks!

On Jul 15, 2008, at 12:49 PM, Corbin Dunn wrote:

As Jens said, it sounds like you may have a nil dataTable. Check that first.

Second, break on:

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

and make sure you aren't returning 0, which would cause the other method to not be called at all.

corbin

On Jul 15, 2008, at 9:32 AM, JArod Wen wrote:

You are right. I found that the - tableView:objectValueForTableColumn:row: has never been called... Any way to fix this problem?

On Jul 13, 2008, at 1:43 AM, Jens Alfke wrote:


On 12 Jul '08, at 10:35 PM, JArod Wen wrote:

The problem is that after I update the data source, which is tableSource in tableController, [dataTable reloadData] will not update the table view in the window

You're sure that, at runtime, 'dataTable' is not nil? It's easy to overlook an outlet when wiring up the nib, and a nil object pointer acts as a no-op.


If that's not the problem, add an NSLog call to your - objectValueForTableColumn: method, so you can see whether it's getting called again after you call reloadData.


--------------- JArod Wen




_______________________________________________

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: Problem on reload data source of a table view
      • From: j o a r <email@hidden>
References: 
 >Problem on reload data source of a table view (From: JArod Wen <email@hidden>)
 >Re: Problem on reload data source of a table view (From: Jens Alfke <email@hidden>)
 >Re: Problem on reload data source of a table view (From: JArod Wen <email@hidden>)
 >Re: Problem on reload data source of a table view (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: KVV and the missing Discard Changes button
  • Next by Date: Re: Problem on reload data source of a table view
  • Previous by thread: Re: Problem on reload data source of a table view
  • Next by thread: Re: Problem on reload data source of a table view
  • Index(es):
    • Date
    • Thread