sumit mendiratta
sumit mendiratta

Reputation: 61

-[_UIFlowLayoutSection center]: unrecognized selector sent to instance

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

Answers (1)

Muhammad Umair Gillani
Muhammad Umair Gillani

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

Related Questions