Datepicker iOS 14 crashes on completely empty project

Hi,

In my project I noticed that date-picker component keeps crashing on a specific dates.
Sending this error message:
"Invalid calculation: number of calculated days is not dividable by the number of days in a week.'"

Initially I thought it's something with my project and so on. But after that I had created a new project without any lines of code.

Steps to reproduce the error:
  1. Create new Xcode project

  2. Open Main.storyboard

  3. Drag datepicker from the "+"

  4. Run project

  5. tap over the datepicker and scroll to 1996

Note: This happens only if the date picker is with preferred style: compact and/or inline (default options).

youtu.be/hjskPTB0Ok8

I am using:
Big sur 11.2
Xcode Version 12.4 (12D4e)
Answered by Claude31 in 660604022
I looked at video and did the test with the same DatePicker configuration.

No crash.

I tested with 12Pro simulator. No crash.

Could you post the complete crash log, it is not possible to read on the video.

I am also using 12.4 (12D4e)
Tested on Catalina 10.15.7 (19H114)

What is your MacOS version ?

Maybe you have an Xcode installation issue ?

This was an issue with UIDatePicker and certain timezones that was addressed in iOS 14.5, which was released earlier this Spring.

For any kind of date picker issue, please also post the locale of your device, the calendar you are using and the time zone your device is set to.

Getting DatePickerMode crash in iPad Pro 12.9 inch iOS 15.2.1. Fatal

Exception: NSRangeException 0 CoreFoundation 0x91d3c __exceptionPreprocess 1 libobjc.A.dylib 0x146a8 objc_exception_throw 2 CoreFoundation 0x18a940 -[__NSCFString characterAtIndex:].cold.1 3 CoreFoundation 0x2cb04 __CFPropertyListIsDictPlistAux 4 UIKitCore 0x3e2950 -[UIPickerView selectedRowInComponent:] 5 UIKitCore 0xe285cc -[_UIDatePickerMode_Date _dateForYearRow:] 6 UIKitCore 0xe25658 -[_UIDatePickerMode dateForRow:inCalendarUnit:] 7 UIKitCore 0xe257c8 -[_UIDatePickerMode titleForRow:inComponent:] 8 UIKitCore 0xe26ec8 -[_UIDatePickerMode viewForRow:inComponent:reusingView:] 9 UIKitCore 0xe31f84 -[_UIDatePickerView pickerView:viewForRow:forComponent:reusingView:] 10 UIKitCore 0x530a44 -[UIPickerView tableView:cellForRowAtIndexPath:] 11 UIKitCore 0x4818c0 -[UIPickerColumnView tableView:cellForRowAtIndexPath:] 12 UIKitCore 0x27217c -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] 13 UIKitCore 0x45fbe8 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] 14 UIKitCore 0x296d74 -[UITableView _updateVisibleCellsNow:] 15 UIKitCore 0x83998 -[UITableView _cellForRowAtIndexPath:usingPresentationValues:] 16 UIKitCore 0x406b70 -[UITableView cellForRowAtIndexPath:] 17 UIKitCore 0x3c6efc __61-[UIPickerTableView selectRow:animated:notify:updateChecked:]_block_invoke 18 Foundation 0x8a9a4 NSINDEXSET_IS_CALLING_OUT_TO_A_BLOCK 19 Foundation 0x1f70c __NSIndexSetEnumerate 20 UIKitCore 0x4c5604 -[UIPickerTableView selectRow:animated:notify:updateChecked:] 21 UIKitCore 0x49edb0 -[UIPickerView _selectRow:inComponent:animated:notify:] 22 UIKitCore 0xe306e4 -[_UIDatePickerView _selectRow:inComponent:animated:notify:] 23 UIKitCore 0xe25e8c -[_UIDatePickerMode loadDate:animated:] 24 UIKitCore 0xe3068c -[_UIDatePickerView _loadDateAnimated:] 25 UIKitCore 0xe2fbfc -[_UIDatePickerView didChangeDateFrom:animated:] 26 UIKitCore 0xe2fef4 -[_UIDatePickerView _setMode:] 27 UIKitCore 0xe3005c -[_UIDatePickerView didChangeMode] 28 UIKitCore 0xe1d160 -[UIDatePicker setDatePickerMode:] 29 DAWPatient 0x19a4b0 AboutMeViewController.configureDatePicker() + 116 (AboutMeViewController.swift:116) 30 DAWPatient 0x199874 AboutMeViewController.viewDidLoad() + 74 (AboutMeViewController.swift:74) 31 DAWPatient 0x199ef8 @objc AboutMeViewController.viewDidLoad() () 32 UIKitCore 0x19c6c8 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] 33 UIKitCore 0x19f03c -[UIViewController loadViewIfRequired] 34 UIKitCore 0x173554 -[UIViewController view] 35 UIKitCore 0x35c598 -[UINavigationController _startCustomTransition:] 36 UIKitCore 0x4ae0ac -[UINavigationController _startDeferredTransitionIfNeeded:] 37 UIKitCore 0x38df20 -[UINavigationController __viewWillLayoutSubviews] 38 UIKitCore 0x2bc720 -[UILayoutContainerView layoutSubviews] 39 UIKitCore 0x17d964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 40 QuartzCore 0x3cb6c CA::Layer::layout_if_needed(CA::Transaction*) 41 QuartzCore 0x2fc58 CA::Layer::layout_and_display_if_needed(CA::Transaction*) 42 QuartzCore 0x433dc CA::Context::commit_transaction(CA::Transaction*, double, double*) 43 QuartzCore 0x4b8d4 CA::Transaction::commit() 44 QuartzCore 0x2f3b8 CA::Transaction::flush_as_runloop_observer(bool) 45 CoreFoundation 0x3dfc4 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION 46 CoreFoundation 0xf608 __CFRunLoopDoObservers 47 CoreFoundation 0xab9c __CFRunLoopRun 48 CoreFoundation 0x1de1c CFRunLoopRunSpecific 49 GraphicsServices 0x19a0 GSEventRunModal 50 UIKitCore 0x4ec600 -[UIApplication _run] 51 UIKitCore 0x281b08 UIApplicationMain 52 DAWPatient 0x6670 main + 19 (FirstOnBoardView.swift:19) 53 ??? 0x10473c250 (Missing)

Datepicker iOS 14 crashes on completely empty project
 
 
Q