*** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory

报错提示:

*** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UICollectionView.m:3307

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'invalid nib registered for identifier (SXDealCellID) - nib must contain exactly one top level object which must be a UICollectionReusableView instance'

解决方案:

  在自定义xib时,额外多了一个控件在另外的区域,把此控件删掉即可。

上一篇:vscode中js文件失去高亮/没有智能提示


下一篇:C#学习笔记(十五):预处理指令