1
10 개의 섹션을 포함하고 각 섹션에 2 개의 셀이있는 UICollectionView가 있습니다. 나는 셀을 삭제하려고하지만 난이 점점 오전 :업데이트 후에 컬렉션보기에 포함 된 섹션 수는 업데이트 전과 같아야합니다.
The number of sections contained in the collection view after the update (2) must be equal to the number of sections contained in the collection view before the update (2)
이 내가 제거하는 방법입니다
NSUInteger arrayLength = 1;
NSUInteger integerArray[] = {0,0};
NSIndexPath *aPath = [[NSIndexPath alloc] initWithIndexes:integerArray length:arrayLength];
[self.collectionFavs deleteItemsAtIndexPaths:[NSArray arrayWithObject:aPath]];
난 그냥 셀과 셀 또는 섹션을 삭제할. 내 실수는 무엇입니까?
이제 작동 중입니다 ... 대단히 감사합니다. 그러나 이것은 섹션을 제거하기 때문에 섹션 내부의 셀만 제거 할 수 있습니까? – onivi
이상하게 보입니다. 데이터 소스 프로토콜에는 두 가지 메소드가 있습니다. - collectionView : numberOfItemsInSection : and - numberOfSectionsInCollectionView :. 먼저 일부 섹션에서 설정된 셀 수에 사용되며, 섹션 수가 설정된 경우 두 번째로 필요합니다. 어쩌면 잘못된 배열에서 객체를 제거 할 수 있습니까? :) – Josshad
10 개의 섹션이 있고 각 섹션에는 2 개의 셀이 있습니다. 개별적으로 각 셀을 제거하려고하지만 모든 셀이 섹션에서 제거되면이 섹션도 제거하려고합니다. – onivi