views:

243

answers:

1

I have a UITableView with a segmented control at the top. When you tap on the different segments, I want the table to reload with a new different sized array. I have tried everything including [self.tableView reloadData]. When you click on a different tab now, it only changes the cells that are out of view and does not add any more. Any ideas??? Thanks.

A: 

In your numberOfRowsinSection method, are you returning the count of the correct datasource when the segment selection is switched? When you select a segment, you would need to call 'reloadData' on the tableview, you would need to check the count you are returning from 'numberOfRowsInSection' and you would need to use the correct datasource in cellForRowAtIndexPath to provide your cell contents.

Hetal Vora