shanke shanke - 5 months ago 8x
iOS Question

IOS Dev - How to make those empty table cells invisible?

As you can see here, I have only 2 data for testing and they are loaded into the table view . This is good. But, there are many empty cells have also been automatically generated.

How to make these empty cells invisible?

enter image description here

yourtableViewname.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];


    - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 
     return 0.01f;

and for iOS 7

 self.yourtableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];