Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listDidAppear 时 view.superview 为空 #454

Open
klaus01 opened this issue Jul 18, 2022 · 1 comment
Open

listDidAppear 时 view.superview 为空 #454

klaus01 opened this issue Jul 18, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@klaus01
Copy link

klaus01 commented Jul 18, 2022

bug描述
我的界面在 viewDidAppear 时有判断 view.superview 做一些逻辑,然而使用 JXCategoryView 后发现触发 viewDidAppear 时,self.view.superview 为 nil。这不符合生命周期逻辑。调试发现是这里的问题。

UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0]];

cell 为 nil,这里应该使用[self.collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]来获取 cell。

版本号
1.JXCategoryView版本号:1.5.9
2.手机系统版本号:15.5
3.手机型号:iPhone 12 mini

复现步骤

  1. 遇到问题的相关效果、类是:JXCategoryListContainerView.containerType == JXCategoryListContainerType_CollectionView

截图
image

viewDidAppear 调用栈:
image

@klaus01
Copy link
Author

klaus01 commented Jul 18, 2022

看 1.6.1 的代码,问题依然存在。

@pujiaxin33 pujiaxin33 added the bug Something isn't working label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants