insertRowsAtIndexPathsを使用しようとしているので、テーブル行を挿入できます。私はこのエラーを取得しています:私が何をしようとしています何UITableViewの行数を動的に変更しようとするとNSInternalInconsistencyExceptionが発生する
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted).'
は動的問題を整流で私の試みで、セクション内の行数を変更することです:
NSArray *indexPathIndex = [NSArray arrayWithObjects:[NSIndexPath indexPathForRow:0 inSection:0], nil];
[myTableView beginUpdates];
//***** HERE I AM TRYING TO DYNAMICALLY INCREASE NUMBER OF ROWS
[myTableView numberOfRowsInSection:1];
////////////////////////////////////////////////////////////
[myTableView insertRowsAtIndexPaths:indexPathIndex withRowAnimation:UITableViewRowAnimationTop];
[myTableView endUpdates];
最初に、行の私の電話番号を上記のエラーに対処するために私はこの数を増やそうとしますが、コード[myTableView numberOfRowsInSection:1]は何の効果もないようです。
誰かがこの問題をどのように解決できるかお勧めしますか?
ありがとう、 ビクター。
あなたは – crashmstr