开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜