私はUITableView
を持っています。これはJSON文字列のデータで埋められます。 pastebinのコードをご覧ください。その時点でreloadRowsAtIndexPathsがJSON imageUrlsでクラッシュする
:
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.tableView.beginUpdates()
self.tableView.reloadRowsAtIndexPaths(
[indexPath],
withRowAnimation: .Fade)
self.tableView.endUpdates()
})
、それが失敗しました。私はreloadRowsAtIndexPaths
を削除する場合、それは動作しますが、私はあなたがスクロールしたり、デバイスを回転させる場合を除いて行を更新しない、
2016-11-06 16:32:06.579471 SO-33975355[4872:1389586] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 7 from section 0 which only contains 0 rows before the update'
:
は、私は、次のメッセージが表示されます。もちろん私はそれを直接更新したい。
私はそれが速くなることと関係があると思いますか?しかし、私はthis from the exampleを変更して以来、私は完全に無知です。 (この例ではJSONではなくwikipediaのURLを使用できます)
誰かが助けてくれたら嬉しいです。