Reputation: 61
How can I fix this crash:
-[_UIFlowLayoutSection center]: unrecognized selector sent to instance.
I am doing:
UICollectionViewFlowLayout *collectionLayout = [[UICollectionViewFlowLayout alloc] init];
collectionLayout.minimumInteritemSpacing = 0.0;
collectionLayout.minimumLineSpacing = 0.0;
collectionLayout.sectionInset = UIEdgeInsetsMake(0.0,0.0,0.0,0.0);
[collectionLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
[_collectionView setCollectionViewLayout:collectionLayout];
Upvotes: 3
Views: 314
Reputation: 157
try to reload the collectionView before setting it's flowlayout.
i was having the same issue and was resolved by reloading the collectionView before setting flowlayout.
Upvotes: 5