I have a collection view and I subclassed the collection view cell so I have have repeating content.
Within my collection view class, I use this method to access and set the objects in my cell, for example set a label that is attached to a cell?
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
CollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CollectionViewCell" forIndexPath:indexPath];
//Configure Cell
//Set Name
DataManager *dm = [DataManager sharedInstance];
NSMutableArray *names = [dm objectForKey:@"nameArray"];
NSString *name = [names objectAtIndex:indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"%@", name]; //set cell here
return cell;
}
However, I need to update the cell.textLabel
, but I cannot access the cell.textLabel
in other methods?
How can I access the cell.textLabel
in other methods other than this one?
*note, I want to update ALL my cells, not just one cell.