Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix XCode warning about cached attributes #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crrobinson14
Copy link

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
Member

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

@tcheard
Copy link

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