Skip to content

Fix XCode warning about cached attributes#98

Open
crrobinson14 wants to merge 1 commit intoCitrrus:masterfrom
crrobinson14:patch-1
Open

Fix XCode warning about cached attributes#98
crrobinson14 wants to merge 1 commit intoCitrrus:masterfrom
crrobinson14:patch-1

Conversation

@crrobinson14
Copy link
Copy Markdown

XCode 7 / iOS 9 (perhaps earlier?) reports UICollectionViewFlowLayout has cached frame mismatch about the above pattern. Working from a copy resolves the issue.

XCode 7 / iOS 9 (perhaps earlier?) reports `UICollectionViewFlowLayout has cached frame mismatch` about the above pattern. Working from a copy resolves the issue.
@MattCBowman
Copy link
Copy Markdown
Member

Thanks @crrobinson14! I'll try to get this integrated in the next few days.

@tcheard
Copy link
Copy Markdown

tcheard commented Feb 17, 2016

Using the copy function on [super layoutAttributesForElementsInRect:rect] only does a shallow copy and still triggers the warning.

See: http://stackoverflow.com/a/33172179/2709382

NSArray* attributesToReturn = [[NSArray alloc] initWithArray:[super layoutAttributesForElementsInRect:rect] copyItems:YES]; is better.

The copy function seems sufficient for [super layoutAttributesForItemAtIndexPath:indexPath]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants