user739509 user739509 - 2 years ago 161
iOS Question

UITableView Edit mode

I have

and I am trying to load it by default in edit mode. The problem is when I this line
my rows disappear, I implemented this methods:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the specified item to be editable.
return YES;

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
return UITableViewCellEditingStyleDelete;

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
return NO;

but with no luck. What should I do?

Answer Source

as Anish pointed to using

[tableView setEditing: YES animated: YES]; 

But you need to have it in viewWillAppear view event to make it work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download