2010-09-10 107 views
4

流程就像这样......用户看到一个UITableView,当用户点击“编辑”时,用户可以删除UITableView的单元格,之后,他/她点击完成确认。当用户点击完成键时调用哪个方法?谢谢。UITableView有没有退出编辑模式?

回答

4

UITableViewController它是setEditing:NO作为参数。

2

通过重写UITableViewController的setEditing:animated:方法,您将收到您正在查找的消息。

- (void)setEditing:(BOOL)editing animated:(BOOL)animated { 
    [super setEditing:editing animated:animated]; 

    if (editing) { 
     // User tapped the edit button 
    } else { 
     // User tapped the done button 
    } 
} 
+1

这应该是接受的答案 – Ohmy 2017-12-02 20:30:20