15 Nov 2008, 18:14
Eastridge_pragsmall

James Kerr (40 posts)

In the screencast episode 1, you showed us how the UITableVIewDelegate has a required method

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath


Actually, the UITableViewDelegate protocol doesn’t declare this method. UITableView does declare the method, but without the tableView: part of the selector.

Can someone explain what’s up with this? The method works as expected, but you would be pretty confused by the documentation

15 Nov 2008, 22:56
Generic-user-small

Bill Nalen (13 posts)

It’s a required method of the UITableViewDataSource interface, not the delegate. You must implement the 2 required data source methods, you are not required to implement any of the delegate methods.

15 Nov 2008, 23:00
Generic-user-small

Bill Nalen (13 posts)

It’s a required method of the UITableViewDataSource interface, not the delegate. You must implement the 2 required data source methods, you are not required to implement any of the delegate methods.

16 Nov 2008, 00:57
Eastridge_pragsmall

James Kerr (40 posts)

Oops, I should have said UITableViewDataSource. The method is NOT listed in the docs for UITableViewDataSOurce, but IS declared in UITableView.h in the @protocol section, so I guess it’s just a typo in the docs. Weird, since in the screencast episode, Bill copies and pastes the method right out of the docs. That is what led to my question, because when I tried to do the same thing, the method was not there. Here’s the listing from the UITableViewDataSource Protocol docs:

Configuring a Table View
– numberOfSectionsInTableView: optional method
– tableView:numberOfRowsInSection:
– sectionIndexTitlesForTableView: optional method
– tableView:sectionForSectionIndexTitle:atIndex: optional method
– tableView:titleForHeaderInSection: optional method
– tableView:titleForFooterInSection: optional method

Note the method is mising in action.

JK

16 Nov 2008, 06:13
Generic-user-small

Bill Nalen (13 posts)

Are you sure you have the latest docs? It shows up in mine. I’m using the docs from the Xcode installed with the iPhone 2.1 sdk, and then updated the docs from within the doc viewer.

16 Nov 2008, 08:27
Eastridge_pragsmall

James Kerr (40 posts)

Thanks, Bill, I now have the latest docs, and yes, it’s there.

JK

  You must be logged in to comment