Hey Guys i am currently trying to stopping one tableviewcell from being editable.
But the solutions i found on the internet do not work how they should.
This is the code i use :
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
if (indexPath.section == 1) {
if (indexPath.row == self.results.count+1) {
return NO;
}
}
return YES;
}
The Problem here is that the tableview cell is not editable anymore but it still shows the red
delete badge if i enable the editingstyle of my tableview like this :
- (void) barButtonItemEditPressed: (id) sender
{
[self.navigationController setToolbarHidden:NO animated:YES];
[self.tableView setEditing:YES animated:YES];
[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:self.barButtonItemDone, nil] animated:YES];
[self.navigationItem setLeftBarButtonItem:self.barButtonItemCancel animated:YES];
}
So what i am doing wrong ?
You need to add edit style as well