Check that you are returning the correct number of elements in the UICollectionViewDataSource methods:
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
and
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView