问题描述
如果我想在编辑模式下放置tableView。什么是正确的电话呢?我似乎能够通过调用 [super setEditing:YES animated:YES]
在编辑模式下放置一个tableView是否有必要也调用 tableView setEditing:YES animated:YES]
?
If I want to put a tableView in editing mode. What is the correct call to do that? I seem to be able to put a tableView in editing mode just by calling [super setEditing:YES animated:YES]
is it necessary to also call [tableView setEditing:YES animated:YES]
?
推荐答案
UITableViewController
的子类?在这种情况下,调用super是足够的,因为 UITableViewController
在视图控制器自身开始编辑时自动将其表视图置于编辑模式。
I assume that you're calling this in a subclass of UITableViewController
? In this case, the call to super is sufficient because UITableViewController
automatically puts its table view in editing mode when the view controller itself starts editing.
如果你有一个常规的 UIViewController
刚刚也包含一个 UITableView
必须自己这样做。
If you'd have a regular UIViewController
that just happens to also contain a UITableView
, you would have to do that yourself.
这篇关于iOS - setEditing [super setEditing ...]和/或[tableView setEditing ...]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!