I have never used UICollectionViewController
s, and I thought that they were somewhat similar to UITableViewController
s, but to my surprise, I cannot add UI elements to my custom UICollectionViewCell
s in the same way as I do with custom UITableViewCell
s.
In fact, I can add labels, buttons, etc. in the Interface Builder, but when I run the application, the cells appear empty.
I have registered the cell class during the viewDidLoad
method by calling (void)registerClass:(Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier
, and I've checked that I am returning a valid instance of UICollectionViewCell
in the (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
method.
What am I doing wrong?