iPhone have a crash that will must appear on iOS16.5.1。 I submit a demo,iphone setting list as follows:
- iOS 16.5.1
- language : French
- region: Tunisia
- Date&Time:
- 24-Hour Time : enable
- SetAutomatically : disable
- Time Zone : Tunisia
- Time : 22:02
Demo Code as follow:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 200, 200)];
[btn setTitle:@"Click" forState:UIControlStateNormal];
btn.backgroundColor = [UIColor blueColor];
[btn addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
}
- (void)btnAction {
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
[datePicker setCalendar:calendar];
}