Delete row from uitableview crashes?

You probably need to change the number returned in.

Up vote 0 down vote favorite share g+ share fb share tw.

I simply try to delete a row from a uitableview with the following code: - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { self. TableView deleteRowsAtIndexPaths:NSArray arrayWithObject:indexPath withRowAnimation:UITableViewRowAnimationFade; } } The problem is that my app crashes. (GDB: Program received signal: "EXC_BAD_INSTRUCTION".

) Anybody know why? Thanks in advance. Sean iphone uitableview delete crash row link|improve this question edited Feb 9 '10 at 14:20Vladimir53.3k574102 asked Feb 9 '10 at 14:11Sean68412 50% accept rate.

If not, try adding that and seeing where execution stops. – kubi Feb 9 '10 at 14:17 also, if you put 4 spaces in front of your code it will be better formatted and easier to read. – kubi Feb 9 '10 at 14:18 ok, thanks for formatting my code.

The execution stops here: +NSException raise:format:arguments: ... any idea? – Sean Feb 9 '10 at 14:27 Is there error description in console? – Vladimir Feb 9 '10 at 14:29.

You probably need to change the number returned in - (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section for the indexPath. Section to be one lower than before the deletion.

Ok, i'll try this. Thanks! – Sean Feb 9 '10 at 14:29 1 yep, I had to remove the object out of my array first before deleting this row.

Know it works! Thanks – Sean Feb 9 '10 at 14:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send