The UITableView is Populated using the NSMutuableArray.
I had displayed values from NSArray into the UITableViewCell,
What i need is delete the individual cell from TableView, for this i need to delete particular element from nsArray using [<arrayname> removeObjectAtIndex: indexPath.row];
and then reload the tableview.
What else i am suppose to do, Do i need to write any tableView Delegate Methods.
Is your array stored somewhere like in a plist? Because if your declaring it on viewDidLoad with all its objects and remove one during runtime, the next time your app loads it will be back. I suggest if you want to populate a table view with array data and be able to delete, then save a NSArray to NSUserDefaults and use setObject, and removeObjectAtIndex.
I'm not 100% sure I understand the problem you're having, but are you using the TableViewDataSource protocol? If you are, and you're implementing
tableView:commitEditingStyle:forRowAtIndexPath:
then you should be able to handle changing the data source and animating the deletion of the row in one stroke. That method is called when the tableview is sent an "insert" or "delete" message and is basically there to allow the TableViewDataSource to make changes to match the view's content.
Also, are you using Core Data to model your content? it seems like persisting your data in a relational model instead of custom objects might be easier. That way each array is only holding an fundamental object (NSString, int, BOOL), and that's all tied together at runtime
so what's the correct one? I might use that instead so the user will at least know that the cell is being deleted by fading out the cell or something.
Insert or delete rows. Reloading the whole table is brute force. See the overview presentation in the table view link in my signature. I really need to get the next blog post written.
Insert or delete rows. Reloading the whole table is brute force. See the overview presentation in the table view link in my signature. I really need to get the next blog post written.