UICollectionView number of cells in the section

iphone, objective-c, uicollectionview

Solution

Use this method for the the collection view to find number of items in a section

- (NSInteger)numberOfItemsInSection:(NSInteger)section;

You can call it using your UICollectionView object as.

NSInteger numberOfItems = [myCollectionView numberOfItemsInSection:2];

Where 2 is the section for which you want to find the number of items.

Problem

How to count the number of cells in the section? I need to know the number of cells in the section during the cell selection.

Original source