PDA

View Full Version : UITableViewDelegate problem




sujithkrishnan
May 14, 2008, 05:33 AM
Hi guys,

I came across a problem regarding the usage of UITableViewDelegate for one of my apps.

As it contains many methods , i implemented almost all and i found that only two are executing and the third method is not executing.

( delegate methods are called when i call reloadData, and the noOfSections and noOf Rows are gettiing initialized, but the method for allocation of cells for each row is not getting executed.

Kindly help me....



mysticwhiskey
May 14, 2008, 05:57 AM
Hi guys,

I came across a problem regarding the usage of UITableViewDelegate for one of my apps.

As it contains many methods , i implemented almost all and i found that only two are executing and the third method is not executing.

( delegate methods are called when i call reloadData, and the noOfSections and noOf Rows are gettiing initialized, but the method for allocation of cells for each row is not getting executed.

Kindly help me....

Hi,

It's a bit hard without seeing your code, but I'm wondering if you have set the UITableView's dataSource property to a valid UITableViewDataSource object? Without this, the tableview won't actually display anything, thus probably leading to the situation you're seeing where the delegate methods aren't called because they aren't needed.

Just guessing though without seeing the code.

Sbrocket
May 14, 2008, 12:01 PM
but the method for allocation of cells for each row is not getting executed.

These methods are part of the UITableViewDataSource protocol rather than the protocol for UITableViewDelegate. Make sure that your class implements both protocols and that you set myTableView.dataSource = yourDataSourceClass.