行/セルをテーブルビューに追加しようとしていますが、[テーブルendUpdates]の前です。...アプリがエラーでクラッシュします:
*-[UITableView _endCellAnimationsWithContext:]、/ SourceCache / UIKit / UIKit-2372 / UITableView.m:909でのアサーションの失敗*キャッチされない例外'NSInternalInconsistencyException'によるアプリの終了、理由:'行33をセクション0に挿入しようとしましたが、更新後のセクション0の行はわずか33行です。
-(IBAction)createTask
{
Data *sharedManager = [Data sharedManager]; //singleton class
[Table beginUpdates];
[Table insertRowsAtIndexPaths:[NSArray arrayWithObject:
[NSIndexPath indexPathForItem:
[sharedManager._NAME count] inSection:0]]
withRowAnimation:UITableViewRowAnimationNone];
// sharedManager._NAME is NSMutableArray wich consists names for cells
[Task_handler createTask]; // adds objects to NSMutableArray's
// (like names for cels and so on)
[Table endUpdates];
[Table reloadData];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
Data *sharedManager = [Data sharedManager];
NSLog(@"numberOfRowsInSection : %d",[sharedManager._NAME count]);
return [sharedManager._NAME count];
}
前もって感謝します。