gpt4 book ai didi

ios - UICollectionView传入collectionView :numberOfItemsInSection: is nil

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

我在使用 Storyboard的 uiviewcontroller 中有一个 Collection View 。调用了 View Controller 委托(delegate)方法,但 collectionView 参数在变量 View 上为 nil。我无法将 View 用于任何用途,我可以使用 NSLog 在控制台上记录它,但不能使用 po。例如在

- (NSInteger)collectionView:(UICollectionView *)cv numberOfItemsInSection:(NSInteger)section

cv 在变量 View 中为 nil。可能是什么原因?

enter image description here

enter image description here

最佳答案

您确定您没有处于“发布”模式吗?

如果您想调试您的应用程序,您需要处于“ Debug模式”。

要检查,请转到左上角靠近开始按钮的位置,然后单击您的项目名称。然后选择“编辑方案”。在“信息”选项卡上,您应该将构建配置设置为“调试”,而不是“发布”。

如果您处于“释放”模式,那么在断点处停止对您没有任何好处。一切都将显示为零。

关于ios - UICollectionView传入collectionView :numberOfItemsInSection: is nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23923946/

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