1

tableView で隣接していない 2 つのセクションをリロードするにはどうすればよいですか? たとえば、セクション 0 と 4 をリロードしたい場合。

[NSIndexSet indexSetWithIndexesInRange: withRowAnimation:];

その間のすべてのセクションをリロードするからですよね?

の連続呼び出しも試しました

[NSIndexSet indexSetWithIndex: withRowAnimation:]

しかし、うまくいかず、次のエラーが発生しました。

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 1.  The number of rows contained in an existing section after the update (8) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).' 

編集:申し訳ありませんが、更新時に、リロードされたセクションごとに行数が変更されることを忘れていました。

4

1 に答える 1

1

各 reloadSections: 呼び出しの前に 1 つのセクションのデータのみが変更されるように、 reloadSections: 呼び出しを並べ替えるだけで問題を解決できました。

于 2013-06-10T04:56:33.540 に答える