4

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
Jim
  • 3,254
  • 1
  • 19
  • 26
  • We have raised this issue as a bug with Apple and will add an answer to the thread once we receive a response – Jim May 16 '11 at 18:16
  • 2
    I had this error show up when i tried to pass in a really wrong date – J3RM Jan 18 '12 at 17:53

2 Answers2

0

have you created a property for your instance variable pickerView? Since you have not mentioned it in the question, I am wondering how you are accessing the setter methods for the pickerView without creating a property like @property(nonatomic, retain) UIDatePicker *pickerView;

Nitin Alabur
  • 5,812
  • 1
  • 34
  • 52
  • If we didn't have the above in the header file the code wouldn't compile. (Also note that the code works for most circumstances, just not these specific Region Formats and Calendar configurations). The reason I put the variable type in the above example was to make it clear what pickerView was in code. The bug has been filed under Apple's bug reporting process. – Jim Jul 03 '11 at 22:50
0

This was previously a bug which is now resolved with the release of iOS 5.

Jim
  • 3,254
  • 1
  • 19
  • 26