我們使用標準UIDatePicker視圖來允許用戶使用選擇器設置倒數時間。代碼如下:將區域格式設置爲臺灣日歷的setDatePickerMode調用爲日語時,UIDatePicker異常
//in the header file
UIDatePicker *pickerView;
//in the implementation file, the error is thrown when this line executes
[self.pickerView setDatePickerMode:UIDatePickerModeCountDownTimer];
這在大多數情況下正常,但是我們誰都有自己的區域設置的格式來臺灣,他們的日曆日本用戶。以下異常則發生:
2011-05-08 21:38:13.701 AppName的[6418:207] *斷言 故障 - [UIDatePickerView _updateRowInColumn:toValue:withRepeatingAmount:元件:動畫:] , /SourceCache/UIKit_Sim/UIKit-1447.6.4/UIDatePicker.m:1499 2011-05-08 21:38:13.703 AppName的[6418:207] 終止應用程序 由於未捕獲的異常 'NSInternalInconsistencyException', 原因:'哇!對於 柱太多的行:1' 在第一擲 * *調用堆棧:(0的CoreFoundation
0x00fa3be9 __exceptionPreprocess + 185 1 libobjc.A.dylib
0x010f85c2 objc_exception_throw + 47 2的CoreFoundation
0x00f5c628 + [NSException 加註:格式:參數:] + 136 3
基金會
0x000d447b - [NSAssertionHandler handleFailureInMethod:對象:文件:LINENUMBER:描述:] + 116 4的UIKit 0x004b1e4e - [UIDatePickerView _upd ateRowInColumn:toValue:withRepeatingAmount:元素:動畫:] + 695 5 UIKit的0x004b5254 - [UIDatePickerView _loadDateAnimated:] + 1012
有沒有人有上述錯誤或如何解決這方面的經驗?似乎這個組件的公曆和非公曆操作存在問題。從我的理解組件佔用如果沒有提供默認用戶的設置:
從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 2011-05-16 18:16:05
我有這個添加到線程錯誤錯誤顯示當我試圖通過一個非常錯誤的日期 – J3RM 2012-01-18 17:53:17