我正在使用iPhone SDK和Objective-C,我收到以下错误消息:
-[UITableView _endCellAnimationsWithContext:] 中的断言失败,/SourceCache/UIKit/UIKit-984.38/UITableView.m:774 2010-01-08 13:24:16.842 MyAPP[628:20b] 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:'无效更新:第 1 节中的行数无效。更新后现有节中包含的行数 (1) 必须等于更新前该节中包含的行数 (0),加上或减去从该部分插入或删除的行数(0 插入,0 删除)。
这是我扩展部分的代码:
- (void)checkAction:(id)sender
{
//The button is added as subview on a view and the view is section header custom view
UIButton *Button = (UIButton*)sender;
NSLog(@"Button Tag=%d",Button.tag);
if([[self.MySectionIndexArray objectAtIndex:Button.tag] isEqualToString:@"UP"])
{
[self.MySectionIndexArray replaceObjectAtIndex:Button.tag withObject:@"DOWN"];
[ButtonDrop setBackgroundImage:[UIImage imageNamed:@"Up.png"] forState:UIControlStateNormal];
[TableDashBoard reloadSections:[NSIndexSet indexSetWithIndex:Button.tag] withRowAnimation:UITableViewRowAnimationFade];
}
else
{
[self.MySectionIndexArray replaceObjectAtIndex:Button.tag withObject:@"UP"];
[ButtonDrop setBackgroundImage:[UIImage imageNamed:@"Down.png"] forState:UIControlStateNormal];
}
NSLog(@"self.MySectionIndexArray ka title = %@ at index Number=%d",self.MySectionIndexArray,Button.tag);
}