ruslanskorb / RSDayFlow

iOS 7+ Calendar (Date Picker) with Infinite Scrolling.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash iPad pro 12.9-inch

assembleMHN opened this issue · comments

When scrolling backwards in time i get a crash on the ipad pro 12.9 inch simulator with OS 11.4, an exception breakpoint stops at this specific line of code:

UICollectionViewLayoutAttributes *toAttrs = [cvLayout layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:toSection]];

It seems to happen when hitting a date cell at the same time as scrolling. i have not been able to validate if this only happens on the sim as i do not own a ipad pro myself.

Stacktrace:

"
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 12 beyond bounds [0 .. 11]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010b53e1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010a660031 objc_exception_throw + 48
2 CoreFoundation 0x000000010b57e0bc _CFThrowFormattedException + 194
3 CoreFoundation 0x000000010b46de91 -[__NSArrayM objectAtIndex:] + 177
4 UIKit 0x000000010dd92548 -[UICollectionViewFlowLayout layoutAttributesForItemAtIndexPath:] + 313
5 RSDayFlow 0x0000000109e6b92f -[RSDFDatePickerView shiftDatesByComponents:] + 1551
6 RSDayFlow 0x0000000109e68da7 -[RSDFDatePickerView appendPastDates] + 71
7 RSDayFlow 0x0000000109e6e289 __50-[RSDFDatePickerView scrollViewWillBeginDragging:]_block_invoke + 409
8 libdispatch.dylib 0x00000001111807ab _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001111817ec _dispatch_client_callout + 8
10 libdispatch.dylib 0x000000011118c8cf _dispatch_main_queue_callback_4CF + 628
11 CoreFoundation 0x000000010b500c99 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
12 CoreFoundation 0x000000010b4c4ea6 __CFRunLoopRun + 2342
13 CoreFoundation 0x000000010b4c430b CFRunLoopRunSpecific + 635
14 GraphicsServices 0x00000001144a9a73 GSEventRunModal + 62
15 UIKit 0x000000010d286057 UIApplicationMain + 159
16 Assemble 0x0000000108e94137 main + 55
17 libdyld.dylib 0x00000001111fe955 start + 1
18 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
"

Thank you in advance, and thank you for a really great component :)

@assembleMHN Thanks for reporting! Fixed in 1.7.1 🎉