DatePicker crashes on iOS 9.x with message [UILabel setAdjustsFontForContentSizeCategory:]: unrecognized selector sent to instance
Which platform(s) does your issue occur on?
iOS emulator version 9.3 iOS device version 9.2.1 iOS device model me432b/a (iPhone 5s)
Please, provide the following version numbers that your issue occurs with:
It's a NativeScript Angular 5 project
tns --version
3.4.3
tns-ios
3.4.1
Packages Used
"nativescript-modal-datetimepicker": "^1.1.2",
"tns-core-modules": "^3.4.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"moment": "^2.18.1",
Steps to reproduce the bug
Tap on a TextField to fire the modal. It works like charm for iOS > 9.x, but on 9.x the error -[UILabel setAdjustsFontForContentSizeCategory:]: unrecognized selector sent to instance 0x7fb1b3ee18e0 is printed out on the console.
Is there any code involved?
<TextField (ngModelChange)="onInputChange()" editable="false" [text]="personalInfo.dateOfBirth | date:'d MMMM yyyy'" (tap)="openDatePicker()"></TextField>
public openDatePicker(): void {
const picker = new ModalPicker.ModalDatetimepicker();
picker.pickDate({
theme: 'dark',
maxDate: new Date(),
is24HourView: false
}).then((result) => {
this.personalInfo.dateOfBirth = moment(result).toDate();
}).catch((error) => {
this.handleError(error);
})
}
In the meantime, either comment the attribute, or place an if around it, like:
if (titleLabel.respondsToSelector(“adjustsFontForContentSizeCategory”)) { titleLabel.adjustsFontForContentSizeCategory = true; }
@carlosanjos Please try v1.2.0 and let me know if it resolves this issue. Thanks :) this version incorporates PR #27