We are using the standard UIDatePicker view to allow the user to set a countdown duration using the picker. The code is as follows:
//in the header file
UIDatePicker *pickerView;
//in the implementation file, the error is thrown when this line executes
[self.pickerView setDatePickerMode:UIDatePickerModeCountDownTimer];
This works fine in most circumstances, however we have a user who has their region format set to Taiwan and their Calendar to Japanese. The following exception then occurs:
2011-05-08 21:38:13.701
AppName[6418:207] * Assertion
failure in -[UIDatePickerView
_updateRowInColumn:toValue:withRepeatingAmount:element:animated:],
/SourceCache/UIKit_Sim/UIKit-1447.6.4/UIDatePicker.m:1499
2011-05-08 21:38:13.703
AppName[6418:207] Terminating app
due to uncaught exception
‘NSInternalInconsistencyException’,
reason: ‘whoa! too many rows for
column: 1’
** Call stack at first throw: ( 0 CoreFoundation
0x00fa3be9 __exceptionPreprocess + 185
1 libobjc.A.dylib
0x010f85c2 objc_exception_throw + 47
2 CoreFoundation
0x00f5c628 +[NSException
raise:format:arguments:] + 136 3
Foundation
0x000d447b -[NSAssertionHandler
handleFailureInMethod:object:file:lineNumber:description:]
+ 116 4 UIKit 0x004b1e4e -[UIDatePickerView
_updateRowInColumn:toValue:withRepeatingAmount:element:animated:]
+ 695 5 UIKit 0x004b5254 -[UIDatePickerView
_loadDateAnimated:] + 1012
Does anyone have any experience with the above error or how to work around this? It seems like there is a problem with the Gregorian vs non Gregorian operation of this component. From what I understood the component takes the user’s settings if no default is provided:
From UIDatePicker.h:
@property(nonatomic,retain) NSLocale *locale; // default is nil. use current locale or locale from calendar
@property(nonatomic,retain) NSTimeZone *timeZone; // default is nil. use current time zone or time zone from calendar
@property(nonatomic,copy) NSCalendar *calendar; // default is [NSCalendar currentCalendar]. setting nil returns to default
This was previously a bug which is now resolved with the release of iOS 5.