reason: 'Could not load NIB in bundle: "XXXXXXX" with name 'xxCell'

川长思鸟来 2022-08-07 01:36 17阅读 0赞

错误信息:reason: ‘Could not load NIB in bundle: ‘NSBundle (loaded)’ with name ‘collectViewCell’’

查找原因:UICollectionView注册的是时候出错;

如下:

[self.collectionView registerNib:[UINib nibWithNibName:@”schoolViewCell” bundle:nil] forCellWithReuseIdentifier:identifer];

正确应该是cell类的名字,类名字写错了.

谨记:有些类名字很长,不要用手打出来,尽量复制.不要那么自信能拼对.少写或者多写都会导致出错,这是血的教训.

发表评论

表情:
评论列表 (有 0 条评论,17人围观)

还没有评论,来说两句吧...

相关阅读