can*_*boy 18 iphone objective-c uitableview ios
我已经尝试将它放在我的代码的各个部分,比如在commitEditingStyle方法的末尾,但我无法让它停止编辑模式.基本上,我想在没有更多单元格的情况下自动退出编辑模式...
if ([self.tableView numberOfRowsInSection:0] ==0)
{
NSLog(@"this triggers, but doesn't stop editing..");
self.tableView.editing = NO;
[self.tableView endEditing:YES];
}
Run Code Online (Sandbox Code Playgroud)
too*_*ser 10
来自苹果文档:
Note: The data source should not call setEditing:animated: from within its implementation of tableView:commitEditingStyle:forRowAtIndexPath:. If for some reason it must, it should invoke it after a delay by using the performSelector:withObject:afterDelay: method.
因此,在内部调用它commitEditingStyle并不是一个好习惯.
| 归档时间: |
|
| 查看次数: |
14347 次 |
| 最近记录: |