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);
}