diff --git a/MBContactPicker/MBContactCollectionViewFlowLayout.m b/MBContactPicker/MBContactCollectionViewFlowLayout.m index 8f4b996..8e924d4 100644 --- a/MBContactPicker/MBContactCollectionViewFlowLayout.m +++ b/MBContactPicker/MBContactCollectionViewFlowLayout.m @@ -18,7 +18,7 @@ @implementation MBContactCollectionViewFlowLayout - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { - NSArray* attributesToReturn = [super layoutAttributesForElementsInRect:rect]; + NSArray* attributesToReturn = [[super layoutAttributesForElementsInRect:rect] copy]; for (UICollectionViewLayoutAttributes* attributes in attributesToReturn) { @@ -34,7 +34,7 @@ - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath { - UICollectionViewLayoutAttributes* currentItemAttributes = [super layoutAttributesForItemAtIndexPath:indexPath]; + UICollectionViewLayoutAttributes* currentItemAttributes = [[super layoutAttributesForItemAtIndexPath:indexPath] copy]; UIEdgeInsets sectionInset = [(UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout sectionInset];