Я очень долго борюсь с этой проблемой.Collection View didSelectItemAtIndexPath segue
Причина была у меня была коллекция delegate
& datasource
под «CollectionView
» не «CollectionView Controller
», потому что я встроил один collectionView
в один из TableView
Cell
, но когда я хочу, чтобы настроить
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)
{
}
Это мой код
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * Cell;
if (indexPath.section==0)
{
switch (indexPath.row)
{
case 0:
Cell = @"MoviesIntro";
break;
case 1:
Cell = @"影片介紹";
break;
case 2:
Cell = @"Moviesrelative";
default:
break;
}
}
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:Cell];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cell];
}
switch (indexPath.row)
{
case 0:
{
}
break;
case 1:
{
}
break;
case 2:
{
Tony=(CollectionView*)[cell viewWithTag:741];
Tony.pageImages =imagearray;
[Tony reloadData];
}
break;
default:
break;
}
return cell;
}
Вот CollectionView.m код
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
self.pic_url=[comment[indexPath.row] objectForKey:@"pic_url"];
self.name_zh=[comment[indexPath.row] objectForKey:@"name_zh"];
self.name_en=[comment[indexPath.row]objectForKey:@"name_en"];
self.intro=[comment[indexPath.row] objectForKey:@"short_Intro"];
self._id=[comment[indexPath.row] objectForKey:@"_id"];
self.trailer=[comment[indexPath.row] objectForKey:@"trailer"];
self.movieTime=[comment[indexPath.row] objectForKey:@"movieTime"];
self.picH_url=[comment[indexPath.row] objectForKey:@"picH_url"];
self.category=[comment[indexPath.row] objectForKey:@"category"];
self.director=[comment[indexPath.row] objectForKey:@"director"];
self.actor=[comment[indexPath.row] objectForKey:@"actor"];
self.language=[comment[indexPath.row] objectForKey:@"language"];
self.MyList=false;
[UIView animateWithDuration:0.05 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
} completion:^(BOOL finished) {
}];
}
Тони Коллекция view.h/м файлов. pageImages - это NSMutableArray на файлах Tony.h.
, чтобы перейти к другому контроллеру вида, свойства не найден на объекте, так что я даже не знаю, что я могу сделать, это кто-то есть хорошая идея ??
Можете добавить код, пожалуйста? –