¿Cómo configurar UILabel en UICollectionViewCell?
He hecho esto varias docenas de veces con la costumbre y el estándar.UITableView
Células. Todos mis puntos de venta están conectados. losUILabel
es una subvista de miUICollectionViewCell
en IB. MiUICollectionViewCell
objeto hereda la clase adecuada en inspector de identidad.
Como me pongoUILabel
enUICollectionViewCell
?
-(void)setCellName:(NSString *)cellName {
self.cellLabel.text = cellName;
}
ViewController.m- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath {
ADMCell *cell =
(ADMCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"ADMCell"
forIndexPath:indexPath];
[cell setCellName:[NSString stringWithFormat:@"%d",[indexPath row]]];
return cell;
}
Salida de cell.debugDescription:
2013-05-15 22:05:40.191 ProductName[857:c07] cell.debugDescription:
<ADMCell: 0xb35c890; baseClass = UICollectionViewCell;
frame = (245 266; 70 80); layer = <CALayer: 0xb35c780>>`