提问人:Jules 提问时间:10/14/2020 最后编辑:Jules 更新时间:12/13/2020 访问量:1623
线程 1:“-[_UIDatePickerIOSCompactView setHighlightsToday:]:无法识别的选择器发送到实例”
Thread 1: "-[_UIDatePickerIOSCompactView setHighlightsToday:]: unrecognized selector sent to instance"
问:
我从 iOS 14 收到崩溃报告,将 setHighlightsToday 与 UIDatePicker 一起使用。
Thread 1: "-[_UIDatePickerIOSCompactView setHighlightsToday:]: unrecognized selector sent to instance"
我今天看不到突出显示的修复程序?
我知道我还需要检查选择器是否可用。
答:
7赞
Mohit Negi
12/13/2020
#1
你可以试试这个。
if #available(iOS 13.4, *) {
datepicker.preferredDatePickerStyle = .wheels
datepicker.setValue(false, forKeyPath: "highlightsToday")
}
评论
UIDatePickerStyleWheels