我有导航栏,我在其上设置了一个默认编辑按钮,它可以让我删除表格项目。但是,当我的表为空时,它仍将按钮的状态保持为“完成”并且不会返回“编辑”我的代码在这里,在 viewDidLoad
self.navigationItem.leftBarButtonItem = self.editButtonItem;
//My Editing method
-(void)setEditing:(BOOL)editing animated:(BOOL)animated
{
if([userInfoArr count]!=0)
{
[super setEditing:editing animated:animated];
[self.tableView setEditing:editing animated:YES];
}
}