У меня есть хороший вид gridView на firstViewController, а также с UIcollectionview на SecondViewController, теперь моя проблема заключается в том, что если я выберу четвертый элемент в GridView, тогда Collectionview должен показать четвертый item from Zero item (теперь коллекция рассматривается с 0-го индекса)!Как инициализировать uicollectionview с определенным элементом (indexPath)
мой didSelectItemAtIndexPath: что на FirstViewController, здесь я получил значение NSInteger перейти к secondviewcontroller,
- (void)gridView:(KKGridView *)theGridView didSelectItemAtIndexPath:(KKIndexPath *)indexPath
{
NSInteger globalIndex = (indexPath.section * numberOfThumbnails) + indexPath.index;
..............................
}
мой cellForItemAtIndexPath: который находится на secondViewController,
(UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath;
{
itemData =[DataArray objectAtIndex:indexPath.row];
NSString *finalPath = [FileUtils findImagePath:[itemData filename]];
CollectionCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];
[cell.imageView setImage:[UIImage imageWithContentsOfFile:finalPath]];
}