xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.77k stars 1.33k forks source link

DatePickerRow NSRangeException crash issue #1924

Open hhl1809 opened 4 years ago

hhl1809 commented 4 years ago

Im using Eureka 4.3.1 and faced the crash issue below in crash report:

Fatal Exception: NSRangeException 0 CoreFoundation 0x1acb8098c exceptionPreprocess 1 libobjc.A.dylib 0x1ac8a90a4 objc_exception_throw 2 CoreFoundation 0x1acbd63f8 -[NSCFString characterAtIndex:].cold.1 3 CoreFoundation 0x1aca58d34 _CFDataInit 4 UIKitCore 0x1b0b23fdc -[UIPickerView selectedRowInComponent:] 5 UIKitCore 0x1b0b0e704 -[_UIDatePickerMode_Date _dateForYearRow:] 6 UIKitCore 0x1b0b0b6ac -[_UIDatePickerMode dateForRow:inCalendarUnit:] 7 UIKitCore 0x1b0b0c2cc -[_UIDatePickerMode _updateSelectedDateComponentsWithNewValueInComponent:usingSelectionBarValue:] 8 UIKitCore 0x1b0b0c55c -[_UIDatePickerMode selectedDateComponents] 9 UIKitCore 0x1b0b168ac -[_UIDatePickerView _updatedLastSelectedComponentsByValidatingSelectedDateWithLastManipulatedComponent:] 10 UIKitCore 0x1b0b15d38 -[_UIDatePickerView _setDate:animated:forced:] 11 UIKitCore 0x1b0b16260 -[_UIDatePickerView _setMode:] 12 UIKitCore 0x1b0b16380 -[UIDatePickerView setDatePickerMode:] 13 Eureka 0x10641f718 DatePickerCell.setup() + 54 (DatePickerRow.swift:54) 14 Eureka 0x10647e070 closure #1 in implicit closure #1 in Row.cell.getter + 153 (Row.swift:153) 15 Eureka 0x106476e50 Row.baseCell.getter + 150 (Row.swift:150) 16 Eureka 0x1063e6c5c FormViewController.tableView(:heightForRowAt:) 17 Eureka 0x1063e6db4 @objc FormViewController.tableView(_:heightForRowAt:) 18 UIKitCore 0x1b0d7bc30 -[UITableView _estimatedHeightForRowAtIndexPath:] 19 UIKitCore 0x1b0d8aa98 __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke 20 UIKitCore 0x1b0d8a3ac -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] 21 UIKitCore 0x1b0d8c06c -[UITableViewRowData ensureAllSectionsAreValid] 22 UIKitCore 0x1b0d38094 -[UITableView endCellAnimationsWithContext:] 23 UIKitCore 0x1b0d515f0 -[UITableView endUpdatesWithContext:] 24 Eureka 0x1063e2244 FormViewController.rowsHaveBeenAdded(:at:) + 718 (Core.swift:718) 25 Eureka 0x106466648 specialized Section.KVOWrapper.observeValue(forKeyPath:of:change:context:) + 91 (Section.swift:91) 26 Eureka 0x106457f8c @objc Section.KVOWrapper.observeValue(forKeyPath:of:change:context:) () 27 Foundation 0x1acf2ba28 NSKeyValueNotifyObserver 28 Foundation 0x1acf2da84 NSKeyValueDidChange.llvm.6079828102272951676 29 Foundation 0x1acf2b250 NSKeyValueDidChangeWithPerThreadPendingNotifications.llvm.6079828102272951676 30 Foundation 0x1aceb0ea4 -[NSKeyValueNotifyingMutableArray insertObject:atIndex:] 31 CoreFoundation 0x1aca7d048 -[NSMutableArray insertObjects:count:atIndex:] 32 CoreFoundation 0x1acb8a868 -[NSMutableArray replaceObjectsInRange:withObjects:count:] 33 CoreFoundation 0x1acb8adb8 -[NSMutableArray replaceObjectsInRange:withObjectsFromArray:] 34 Eureka 0x106460050 specialized Section.replaceSubrange(:with:) + 283 (Section.swift:283) 35 Eureka 0x10644ef24 InlineRowType<>.expandInlineRow() () 36 Eureka 0x10644f674 protocol witness for BaseInlineRowType.expandInlineRow() in conformance DateInlineRow () 37 Eureka 0x10644e788 InlineRowType<>.toggleInlineRow() + 115 (InlineRowType.swift:115) 38 Eureka 0x10643be5c DateInlineRow.customDidSelect() 39 Eureka 0x106477584 Row.didSelect() + 186 (Row.swift:186) 40 Eureka 0x1063e67b8 FormViewController.tableView(:didSelectRowAt:) + 787 (Core.swift:787) 41 Eureka 0x1063e68a0 @objc FormViewController.tableView(_:didSelectRowAt:) () 42 UIKitCore 0x1b0d54cf0 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:] 43 UIKitCore 0x1b0d5480c -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] 44 UIKitCore 0x1b0d54f0c -[UITableView _userSelectRowAtPendingSelectionIndexPath:] 45 UIKitCore 0x1b0b97b98 _runAfterCACommitDeferredBlocks 46 UIKitCore 0x1b0b877c0 _cleanUpAfterCAFlushAndRunDeferredBlocks 47 UIKitCore 0x1b0bb7594 _afterCACommitHandler 48 CoreFoundation 0x1acafdc48 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION 49 CoreFoundation 0x1acaf8b34 CFRunLoopDoObservers 50 CoreFoundation 0x1acaf9100 CFRunLoopRun 51 CoreFoundation 0x1acaf88bc CFRunLoopRunSpecific 52 GraphicsServices 0x1b6964328 GSEventRunModal 53 UIKitCore 0x1b0b8e6d4 UIApplicationMain 54 Motorist 0x104f8c6b0 main + 36 (VehicleCell.swift:36) 55 libdyld.dylib 0x1ac983460

The crash issue is on iOS 13.1.2, Can anyone help to suggest me a solution for this issue ? Thanks.

hhl1809 commented 4 years ago

Can anyone help ?

jackhuynh-motorist commented 4 years ago

up

jackhuynh-motorist commented 4 years ago

up

mats-claassen commented 4 years ago

Hi, first of all, why aren't you using the latest version? Also could you provide more context like steps to reproduce and some code? Ideally you could provide a way to reproduce the crash in the Examples project or in a small project