Why isn’t cellForItemAtIndexPath being called?

OK, so you’ve built a UICollectionView but this method is never being called:

– (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath

Or perhaps you’ve got a UITableView and this method isn’t being called:

– (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Here’s a checklist you can try:

1. Check your Controller (or its superclass) conforms to the necessary protocols (i.e. it declares it in the interface and has the methods in the implementation)

2. Check you’ve connected your dataSource and delegate from your View to the Controller (right click on View to check)



Leave a Reply

Your email address will not be published. Required fields are marked *