tags:

views:

26

answers:

1

I have built an app which has the ability to delete cells from a table, but only if there are more than two cells.

If there are two or less cells, it only lets me select them. Any ideas?

Here's a video to visualize it: http://slavingia.com/etc/helpme.mov

A: 

If you have the datasource, in the delegate method - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath you can see how many items are in the source, if its less than 2 then you can return none in this method which wont allow editing, otherwise you can return delete style so you can

Daniel
I want to be able to delete all the table cells, but it stops at 2.
Sahil Lavingia