Je voudrais accéder à tous UICollectionViewCell
en UICollectionView
.
Mais dans le code suivant, les sorties de journal seulement null
.
CollectionCell
est la sous-classe de UICollectionViewCell, et titleLabel
est sa propriété.
Avez-vous une idée pour accéder à CollectionCell?obtenir tous UICollectionViewCell
for (NSInteger j = 0; j < [collectionView numberOfSections]; j++) {
for (NSInteger i = 0; i < [collectionView numberOfItemsInSection:j]; i++) {
CollectionCell* cell = [collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:i inSection:j]];
NSLog(@"%@", cell.titleLabel.text);
}
}
Essayez de lancer 'CollectionCell * cellule = (CollectionCell *) [collectionView cellForRowItemAtIndex: Chemin: ZzZ]; '? – Larme
Pourquoi avez-vous besoin de toutes les cellules? – John