常见问题

1.UICollectionViewDemo1[1249:398101] Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set

 出现错误的的原因是没有给你的StoryBoard设置默认显示的controller,在属性检查器面板上的view controller那把“ is install View controller”勾上。

 

2.Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewCell label]: unrecognized selector sent to instance 

UICollectionViewCell不能被实例化,将CollectionViewCell改成自定义类即可

例如:

错误:[self.collectionView registerClass:[CollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];

正确:[self.collectionView registerClass:[CustomCollectionViewCell classforCellWithReuseIdentifier:reuseIdentifier];

 

 

 

 

posted @ 2016-03-03 15:02  lianghe  阅读(144)  评论(0编辑  收藏  举报