iOS錯誤:nib must contain exactly one top level object which must be a...

在經過xib建立collectionView的cell的時候常常會出現這樣的錯誤:

invalid nib registered for identifier (xxx) - nib must contain exactly one top level object which must be a UICollectionReusableView instance

解決方案:

找到控制檯reason後面的identifier括號中的xxx對應的xib文件,刪除和cell同級的其他控件,以下圖的Label控件ide

相關文章
相關標籤/搜索