开发者

Which row did the user swipe-to-delete?

The user swipes 1 of 开发者_开发问答the rows in a UITableView and hits the DELETE button.

The user clicks on DELETE and it brings up an UIActionSheet to pick 1 of 2 dangerous delete choices.

The user clicks on 1 of those buttons... and I run some code called "myCode:".

...

Once inside "myCode:", how do I detect which row the user is trying to delete?

Is there some kind of indexPathForDeletedRow method?

(Similar to the very handy indexPathForSelectedRow method.)


The simplest way is to create an ivar to hold the NSIndexPath associated with the cell pending deletion. Just save that away right before creating and presenting your action sheet.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜