2018-01-15

2018-01-15  本文已影响113人  唐师兄

问题1:iOS Assertion failure in -[TCHomeCollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:]

今天写自定义 collectionView, 因为粗心, 然后发现一个很难见的 bug, 特地记录一下, 举一反三, tableView 这样写也会有这样的问题.
错误日志

*** Assertion failure in -[TCHomeCollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.33.6/UICollectionView.m:2071

为什么会有这个问题呢, 因为我会贴两张图, 大家看看就秒懂了 1515979312696.jpg 1515979274939.jpg

问题2:reference "X" ambiguous

解决方案: 检查是否在.h 和 .m 文件是否都引入了头文件,去掉其一再次编译,看能否通过,如果不能,看是否针对某一类扩展了分类

上一篇 下一篇

猜你喜欢

热点阅读