Быстрый пример:
// create a mutable array to manage your table data
NSMutableArray *tableList;
@property (nonatomic, retain) NSMutableArray *tableList;
в вашем методе viewDidLoad
вы можете инициализировать его данными (хотя вы должны проверить, является ли tableList
нулевым первым)
NSString *path = [[NSBundle mainBundle] pathForResource:@"TableData" ofType:@"plist"];
NSMutableArray *array = [[NSMutableArray alloc] initWithContentsOfFile:path];
self.tableList = array;
[array release];
затем в файле реализации вы реализуете этот метод делегата
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
[self.tableList removeObjectAtIndex:row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
, затем вы можете переключать режим редактирования с помощью
[self.tableView setEditing:!self.tableView.editing animated:YES];