Deleting a Table Row with a Table View
I'm trying to image how can I delete a table row (core data or sqlite) using a Table View.
Well, I can do it with PHP using a hidden Id and then, looking for the matching Id in the data table to delete it.
In 开发者_如何学运维C# with the Entity Framework I can delete a table row with a simple DeleteObject
instruction that will automatically remove it from the data table.
How can I do the same thing with iOS SDK? How can I tell the SDK to get the selected item id, find it in the data table and delete it?
Thank you,
Regards.
Use objectAtIndex:indexPath.row
from within the didCommitEditingStyle
method. This is assuming you have some sort of array that is being used to populate your TableView. This will return the object in your array that corresponds to the row that the user wishes to delete.
精彩评论