我有一个由图像组成的一维数组,我正在将其提供给UICollectionView。集合视图只是由数组中的元素组成的一个部分。当我单击单元格并触发
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
时,我打印出indexPath的值,例如元素0在第0行的值为[0,0],但是该行中的下一个元素是[0,5]。如何将indexPath映射到我的数组,就像UITableView
的[indexPath row]直接匹配相应的索引一样?