Quote:
Originally Posted by jhoney
how can i delete that particular cell in that tableview.....
i already used a code to delete the cell.....
i have given the code below...when i try to run the program using the code...it crases...please help me some one....i don know even wat is the mistake i have done....pls help me....
the code is
[self.statDataTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
it crashes. wats wrong in this code?....help me pls.....
|
You first need to delete the item from the source, so either remove the corresponding object from the array first and then execute this code to remove the Cell, if not then you are going to crash since the number of rows in the table wouldn't match your data source count. So before this line you should have something like
Code:
[myDataSource removeObjectAtIndex:indexPath.row];
Then you can delete the row from the tableview with what you already have above.
Where are you performing this code as well?