2010-09-10 59 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