Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28181] iOS 14: Default date picker crashes when setting "dateTimeColor"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-10-27T21:27:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.2.2
ComponentsiOS
Labelsdatepicker
ReporterHans Knöchel
AssigneeVijay Singh
Created2020-10-08T08:37:16.000+0000
Updated2020-11-04T19:47:43.000+0000

Description

Taken from TiSlack: --- Seems like iOS 14 doesn’t like the dateTimeColor property (causes crash when using a picker with type Ti.UI.PICKER_TYPE_DATE). — Is there any alternative way to change a picker’s text color? *Crash Error (simulator & device)*
[INFO]   -[_UIDatePickerIOSCompactView setHighlightsToday:]: unrecognized selector sent to instance 0x7f8e3d160e30
[INFO]   *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIDatePickerIOSCompactView setHighlightsToday:]: unrecognized selector sent to instance 0x7f8e3d160e30'
--- The reason is that Titanium uses non-offical API's for this (reflection), which is generally okay but error prone for new releases. This year, Apple changed the UIDatePicker styles a lot, causing the initial implementation to break. The fix is to guard iOS 14 as well as the used datePickerStyle (which I added for 9.2.0). PR to fix this: https://github.com/appcelerator/titanium_mobile/pull/12167

Comments

  1. Vijay Singh 2020-10-10

    PR (from [~hknoechel]) - https://github.com/appcelerator/titanium_mobile/pull/12167 Test case - 1.
       const dp = Ti.UI.createPicker({
       	type: Ti.UI.PICKER_TYPE_PLAIN,
       	dateTimeColor: 'red'
       });
       
       win = Ti.UI.createWindow();
       win.add(dp);
       win.open();
       
    2.
       const dp = Ti.UI.createPicker({
       	type: Ti.UI.PICKER_TYPE_DATE,
       	datePickerStyle: Ti.UI.iOS.DATE_PICKER_STYLE_WHEELS,
       	dateTimeColor: 'red'
       });
       
       win = Ti.UI.createWindow();
       win.add(dp);
       win.open();
       
       
  2. Satyam Sekhri 2020-10-22

    FR Passed Waiting for Jenkins build
  3. Christopher Williams 2020-10-23

    merged to master, and backport PR merged to 9_2_X for 9.2.2 target
  4. Satyam Sekhri 2020-10-27

    Verified on: Mac OS: 10.15.4 SDK: 9.3.0.v20201027065511, 9.2.2.v20201026120850 Appc CLI: 8.1.1 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202005141803 Xcode: 12.0.1 iOS Simulator 14.0
  5. Lokesh Choudhary 2020-10-27

    Verified the fix with SDK 9.3.0.v20201027120230 & 9.2.2.v20201026120850. Closing.

JSON Source