UICollectionView registerClass: forCellWithReuseIdentifier method breaks UICollectionView
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What's the role of registerClass:forCellWithReuseIdentifier: method? According to Apple's developer documentation it's supposed to "Register a class for use in creating new collection view cells." When I try to use it my project I get a black collection view. When I delete it everything works fine. #define cellId @"cellId" #import "ViewController.h" #import "Cell.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UICollectionView *collectionView; @property(strong, nonatomic)NSMutableArray * photoArray; @end @implementation