我有关键在于NavigationController是在酥料饼的一个UITableView。于是,我把一个编辑/完成UIToolBarItem工作正常,你可以看到删除附件图标显示出来。然而,当我重新排列物品,编辑/完成按钮停止工作......UITableView的编辑不工作
我调试,它仍然被调用,但它似乎并没有更新,并排序阻止其他按钮的任何进一步的更新。这可能是模拟器的问题吗?
感谢提前的帮助!
编辑:添加代码
addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(editTable:)];
后来就方法:
- (IBAction) editTable: (id) sender
{
if ([[addButton title] isEqualToString:EDIT_STRING]) {
[addButton setTitle:DONE_STRING]; //enabling edit mode
[super setEditing:YES animated:YES];
[[self tableView] setEditing:YES animated:YES];
}
else {
[addButton setTitle:EDIT_STRING]; //done with editing
[[self tableView] setEditing:NO animated:YES];
[super setEditing:NO animated:YES];
[[self tableView] setNeedsDisplay];
[[self tableView] reloadData];
}
}
第二部分绝对称得上为Add按钮文本正在发生变化。但是,它停止工作,一旦我做了编辑(如重新安排行)
请张贴一些代码 – iProgrammer 2011-05-26 05:02:43