ashfurrow / ARCollectionViewMasonryLayout

MIT License
185 stars 16 forks source link

Fixed multiple sections false positive assert in longestDimensionWithLengths when invoked without a collection view. #20

Closed dblock closed 10 years ago

dblock commented 10 years ago

The problem is that setupLayoutWithStaticDimension:andVariableDimensions will assert if you have != 1 section in the collection view. If there's no collection view, you get zero.

2014-06-30 09:31:12.517 Artsy[62742:60b] *** Assertion failure in -[ARCollectionViewMasonryLayout setupLayoutWithStaticDimsion:andVaribleDimensions:], /Users/dblock/source/eigen/dblock/Pods/ARCollectionViewMasonryLayout/ARCollectionViewMasonryLayout.m:148
2014-06-30 09:31:12.624 Artsy[62742:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ARCollectionViewmMasonry doesn't support multiple sections.'
*** First throw call stack:
(
    0   CoreFoundation                      0x031ec1e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x02e038e5 objc_exception_throw + 44
    2   CoreFoundation                      0x031ec048 +[NSException raise:format:arguments:] + 136
    3   Foundation                          0x012074de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4   Artsy                               0x00250532 -[ARCollectionViewMasonryLayout setupLayoutWithStaticDimsion:andVaribleDimensions:] + 658
    5   Artsy                               0x002501f4 -[ARCollectionViewMasonryLayout longestDimensionWithLengths:withOppositeDimension:] + 116
    6   Artsy                               0x00115848 +[ARArtworkMasonryModule intrinsicSizeWithWithLayout:style:andArtworks:] + 1448
    7   Artsy                               0x00115d27 -[ARArtworkMasonryModule intrinsicSize] + 183
ashfurrow commented 10 years ago

:+1:

dblock commented 10 years ago

:green_apple:

1aurabrown commented 10 years ago

good catch, thx