Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

John Baughman

macrumors regular
Original poster
Oct 27, 2003
100
0
I have checked and rechecked things but I cannot get tableView.objectValueForTableColumn:row to fire.

numberOfRowsInTableView is the only table view method getting called when I call [tableView reloadData].

I have set the App Controller as the data source for the Table View and App Controller tableView outlet is set to the Table View. What am I missing.

John
 
If it's not being called at all, the method probably isn't spelled exactly as it should be in the implementation file. Post your objectValueForTableColumn method.
 
If it's not being called at all, the method probably isn't spelled exactly as it should be in the implementation file. Post your objectValueForTableColumn method.

Code:
- (id)tableView:(NSTableView *)aTableView
               objectValueForTableColumn:(NSTableColumn *)aTableColumn      
                                    row:(int)row
{
	
	
}
 
As you already know, that is the correct method. You didn't mention it, but did you also link the delegate of tableView to the AppController object?
 
As you already know, that is the correct method. You didn't mention it, but did you also link the delegate of tableView to the AppController object?

No, but I tried to do that now and it still does not work. To link the delegate I right clicked the Table View and dragged from the Outlet Delegate line to the App Controller... Right?

In the sample code for the book Hillegass did not link the delegate. I can't test the sample as it is not complete in that it does not contain the code for creating a required Amazon.com web services request.

I think what I am going to do unless someone helps me out, is add the necessary code to the sample project and see if tableView method works there.

John
 
No, but I tried to do that now and it still does not work. To link the delegate I right clicked the Table View and dragged from the Outlet Delegate line to the App Controller... Right?

In the sample code for the book Hillegass did not link the delegate. I can't test the sample as it is not complete in that it does not contain the code for creating a required Amazon.com web services request.

I think what I am going to do unless someone helps me out, is add the necessary code to the sample project and see if tableView method works there.

John

Try and clean the project, then compile and run.
 
I found the problem, but don't understand why it breaks the call to the tableView method especially since numberOfRowsInTableView does get called.

In this app we have the following code..

Code:
[itemNodes release];
itemNodes = [[doc   nodesForXPath:@"ItemSearchResponse/Items/Item" error:&error] retain];
if (!itemNodes) {
   NSAlert *alert = [NSAlert alertWithError:error];
   [alert runModal];
   return;
}

// Update the interface
[tableView reloadData];
[progress stopAnimation:nil];

My mistake was instead of having @"ItemSearchResponse/Items/Item" I had @"ItemsSearchResponse/Items/Item". Note the extra s in @"ItemSearch...". Even with the typo, it does not fall into alert for (!itemNodes). So why does reloadData call numberOfRowsInTableView but not the tableView method.

Thanks for all who tried to help. I think I am good to continue on.

John
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.