dans l'application i ont coutume tableview(UITableView *tableView)
qui sous-classe de UIViewController & dans l'édition tableview est montre parfaitement, mais quand je supprimer la ligneapplication de crash de tableview édition dans l'iphone?
- (void)tableView:(UITableView *)tableView1 commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
//[appDelegate deleteItemAtIndexPath:indexPath];
[self testing:indexPath];
[tableView deleteRowsAtIndexPaths:
[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];//in this line app crash
NSLog(@"delete row");
[tableView reloadData];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
//nothing to do item already added
}
}
dans cette méthode lorsque breakpoint va à cette ligne
[tableView deleteRowsAtIndexPaths: [NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
mon plantage de l'application ce que je fais pour en sortir.
- (void) test: chemin (NSIndexPath *) {
Player *doc = [[Player alloc]init];
NSMutableArray* reversedArray = [[NSMutableArray alloc] initWithArray:[[[[NSArray alloc] initWithArray: _data] reverseObjectEnumerator] allObjects]];
doc = [reversedArray objectAtIndex:path.row];
NSLog(@"%@,%d", doc.name,path.row);
[self deleteRow:doc];
}
- (void) deleteRow: (joueur *) {doc
// ReferMeAppDelegate * appDelegate = (ReferMeAppDelegate *) [[délégué UIApplication sharedApplication]]; self.party = [PartyParser loadParty]; if (_party! = Nil) { pour (joueur * joueur dans _party.players) { NSLog (@ "% @,% @", player.name, player.alert); NSComparisonResult resultName, resultEmail, resultPhone, resultLocation; // NSString * str = [appDelegate.plistDict valueForKey: @ "flag"]; // if ([longueur du lecteur]! = 0 & & player.alert == @ "1") { resultName = [nom.du.domaine: player.name]; Resultatmail = [comparez doc.email: player.email]; resultPhone = [Comparer avec doc.phone: player.phone]; resultLocation = [emplacement doc.location: player.location]; if (0 == ResultName & & resultEmail == 0 & & resultPhone == 0 & & resultLocation == 0) { //lblName1.text = @ "égal"; Joueur * playerr = [[Player alloc] init]; playerr = joueur; [_party.players removeObject: playerr]; //[_party.players removeObjectAtIndex: path.row]; pause; } //} longueur de //if([player.email] de == 0 & & de player.alert == @ "2") {{ autre ResultName = [doc.name comparer: player.name]; resultPhone = [Comparer avec doc.phone: player.phone]; if (resultName == 0 & & resultPhone == 0) { Joueur * playerr = [[Player alloc] init]; playerr = joueur; [_party.players removeObject: playerr]; pause;
}} }
for (Player *player in _party.players) {
NSLog(@"after match case player names");
NSLog(@"%@", player.name);
}
[PartyParser saveParty:_party];
}
}
J'utilise xml GData dans l'application qui prennent en charge lecture & opérations d'écriture.
ce est le journal de l'accident sur la console? – Swastik
*** Terminaison de l'application due à l'exception non interceptée 'NSInternalInconsistencyException', raison: 'Invalid update: nombre de lignes incorrect dans la section 0. Le nombre de lignes contenues dans une section existante après la mise à jour (1) doit être égal au lignes contenues dans cette section avant la mise à jour (1), plus ou moins le nombre de lignes insérées ou supprimées de cette section (0 inséré, 1 supprimé). ' 2010-12-09 14: 04: 01.478 ReferMe [29684: 207] Stack: –