Как перезагрузить два раздела в моем табличном представлении, которые не смежны? Например, если я хочу, чтобы перезагрузить разделы 0 и 4. Я не могу использоватьiOS Перезагрузка двух разделов tableView
[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).'
EDIT: К сожалению, я забыл упомянуть, что в моем обновлении количество изменений строк для каждой секции перезагружается.
Как насчет использования UITableView beginUpdates & endUpdates и вставки или обновления новых строк между ними? – tGilani
http://stackoverflow.com/questions/5454708/nsinternalinconsistencyexception-invalid-number-of-rows –
Вы даже посмотрели документацию? -> http://developer.apple.com/library/ios/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instm/UITableView/reloadSections:withRowAnimation: (reloadSections: withRowAnimation :) – borrrden