iOS delete a tableview row

前端 未结 6 1199
北荒
北荒 2020-12-03 23:14

I had my app working fine on iOS 6. With the upgrade I stopped being able to delete rows from my UITableView.

I\'ve a button in my prototype cell.

6条回答
  •  一个人的身影
    2020-12-03 23:57

    You can set the button tag = cell.index in cellForRowAtIndexPath.

    And then

    UITableViewCell *cell = (UITableViewCell *)
            [tableView cellForRowAtIndexPath:
            [NSIndexPath indexPathForRow:btn.tag inSection:0]];
    

    so you can get the index

提交回复
热议问题