gpt4 book ai didi

ios - 在 UICollectionViewController 中使用 segue 时出错

转载 作者:行者123 更新时间:2023-11-29 12:40:25 25 4
gpt4 key购买 nike

CollectionViewController 中使用 didSelectItemAtIndexPath 方法在 StoryBoard 中调用 segue 时出现问题。

这是执行我的应用程序时的错误。

 nested push animation can result in corrupted navigation bar
2014-08-03 16:31:43.292 Geelbe[2050:607] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

这就是方法。

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
//Getting Item Selected.
KidsGrid *itemSelected = [grid_kid objectAtIndex:indexPath.row]; //getting s
self.currentItem = itemSelected;
[self performSegueWithIdentifier:@"gridDetail" sender:self];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
//Configure Kids Detail View Controller
[(ManDetailGridViewController *)segue.destinationViewController setCurrentItem:self.currentItem];
}

有什么想法吗?

最佳答案

尝试删除第一种方法中的所有代码。

在第二个方法中写:

if ([segue.identifier isEqualToString:@"gridDetail"]) {
UICollectionViewCell *cell = sender;
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
KidsGrid *itemSelected = [grid_kid objectAtIndex:indexPath.row]; //getting s

self.currentItem = itemSelected;

[(ManDetailGridViewController *)segue.destinationViewController setCurrentItem:self.currentItem];
}

关于ios - 在 UICollectionViewController 中使用 segue 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25109051/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com