2013-06-10 4 views
1

인접하지 않은 tableView에서 두 섹션을 다시로드하려면 어떻게해야합니까? 예를 들어 섹션 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).' 

편집 : 내 업데이트에 대한 그 얘기를 깜빡 했네요 죄송합니다 다시로드 된 각 섹션마다 행 수가 변경됩니다.

+0

UITableView를 사용하는 방법에 대해 beginUpdates & endUpdates & 사이에 새 행을 삽입하거나 업데이트 하시겠습니까? – tGilani

+0

http://stackoverflow.com/questions/5454708/nsinternalinconsistencyexception-invalid-number-ofrows –

+0

문서를 보셨나요? -> http://developer.apple.com/library/ios/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instm/UITableView/reloadSections:withRowAnimation :(reloadSections : withRowAnimation :) – borrrden

답변

1

각 reloadSections : call 전에 한 섹션의 데이터 만 변경되도록 내 reloadSections : calls 순서를 변경하여 문제를 해결할 수있었습니다.

+0

이것은 나를 괴롭혔고 한 번에 하나의 섹션 만 다시로드하면 모든 것이 작동하는 것으로 보입니다. – Entalpi

관련 문제