Comment puis-je supprimer une ligne UITableView lors d'un balayage? Je sais que la question a été posée, mais je n'ai que des erreurs. Voici le code:Glisser pour supprimer UITableView
-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
// If row is deleted, remove it from the list.
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSInteger row = [indexPath row];
[tableDataSource removeObjectAtIndex:row];
}
}
Mais rien ne se passe. J'apprécierais si vous écrivez le code.
OMG! Et c'était aussi simple que ça! Merci beaucoup! – KillaIce
:) Pourquoi ne pas accepter la réponse alors? –
Je peux le faire en 3 minutes :( – KillaIce