I'm getting a rare crash when using an iOS date picker.
The crash is: NSInternalInconsistencyException Failed to allocate data stores for 100000 rows in section 0. Consider using fewer rows
UITextField *dateinput = [[UITextField alloc] initWithFrame:CGRectMake(26, yOffset, 268, 35)];
[dateinput setPlaceholder:@"Ends:"];
[dateinput setText:@""];
[self configureTextField:dateinput];
[footer addSubview:dateinput];
[self setDateinput:dateinput];
UILabel* dateinputLabel = [[UILabel alloc] initWithFrame: CGRectMake(26, yOffset - 21, 268, 30.0f)];
[dateinputLabel setTextColor:[UIColor colorWithRGBHex:0x777777]];
[dateinputLabel setFont:[UIFont fontWithName:@"Helvetica" size:11]];
[dateinputLabel setBackgroundColor:[UIColor clearColor]];
dateinputLabel.text = @"End Date";
[footer addSubview:dateinputLabel];
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
[datePicker setDatePickerMode:UIDatePickerModeDate]; //crash on this line
[dateinput setInputView:datePicker];
For some reason the date picker is internally allocating a huge number of rows and crashing because not that many rows are available.
Is it correct behaviour for the date picker to allocate so many rows? And if not, can anyone see what I'm doing that is causing this odd behaviour?
Note that I haven't been able to replicate this issue. It's clear that a small number of users are being affected (via crashlytics)