- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我们使用标准的 UIDatePicker View 来允许用户使用选择器设置倒计时持续时间。代码如下:
//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] * 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
有没有人遇到过上述错误或如何解决这个问题?该组件的公历与非公历操作似乎存在问题。据我了解,如果未提供默认值,该组件将采用用户的设置:
来自 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
最佳答案
您是否为您的实例变量 pickerView 创建了一个属性?由于您没有在问题中提到它,我想知道您如何访问 pickerView 的 setter 方法而不创建 @property(nonatomic, retain) UIDatePicker *pickerView;
关于iphone - 调用 setDatePickerMode 时出现 UIDatePicker 异常,区域格式设置为台湾日历为日语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5930270/
我正在制作一个 iPhone 应用程序,我在其中使用 UIDatePicker 并在操作表中显示选定的时间。在操作表中,时间以 10 分钟的间隔显示。当我滚动 Datepicker 时, textfi
这是我第一次尝试 Swift 或 iPhone 应用程序,所以不用说,我现在不确定如何做很多事情。 现在我有一个带有文本字段和按钮的 View Controller 。我设法找到了几乎可以完成我需要的
我目前正在尝试弄清楚如何使用 ( .wheels) 将代码从 iOS 13 UIDatePicker 更改为 iOS 14 版本。您将在下方找到带有无法正常运行的日期选择器的应用程序屏幕截图和代码屏幕
我有 2 个 UITextField 调用同一个 UIDatePicker,如何让 UIDatePicker 知道在文本字段中设置所选日期时调用哪一个 UITextField? 最佳答案 您可以在这些
我需要显示一个带有 uidatepicker 的 View ..我尝试使用presentModalViewcontroller,但使用uidatepicker正确显示了我的新 View Control
iPhone UI 组件 UI DatePicker 不支持横向模式?仅在横向模式下它会抓取 2/3 的宽度。 如何让它用完全宽(480px)? 最佳答案 尝试手动重新/设置 UIDatePicker
我将 UIDatePicker 添加为 UITextField 的输入 View UIDatePicker *oBirth; NSDateFormatter *dateFormat; _edit
我在 UILabel 中有一个日期(例如“2010 年 12 月 14 日”)。我想将此日期设置为我的 UIDatepicker 的最小日期。我该如何做到这一点,请回复? 谢谢尼尚特 最佳答案 使用
我正在尝试构建一个日期选择器,其中今天为最小日期,2011 年 2 月 1 日为最大日期。 我已设置最短日期如下 [picker setMinimumDate: [NSDate date]]; 这工作
我在 iphone 日期选择器中遇到本地化问题。我希望日期选择器仅以英语显示日期,但现在它需要在 iphone 设置中设置为区域的语言。我尝试了各种没有用的方法像下面这样。 在 uidatepicke
我很茫然。我有一个 NSDate 传递给 UIDatePicker。当我设置为东部时区时,一切都很好。 当我设置为“中部”时,日期选择器显示的时间晚了 1 小时。 所以,如果我打开 NSLogs,这就
我想要一个 UIDatePicker,用户可以在其中选择月份和日期,但不能选择年份。我知道闰年多了一天,所以为了简单起见,我们把这一天扔掉。 是否有任何方法可以删除年份列或有 2 个带有月/日的卷轴,
有没有办法将 UIDatepicker 设置为分钟和秒与小时和分钟 编辑我最终添加了自己的 UIPicker 类,并自己创建了值和标签。 最佳答案 我认为 SDK 中没有任何内置方法可以执行此操作。尝
我在我的应用程序中创建了一个 UIDatePicker,并且还支持多种语言。我的 UIDatePicker 是在 Interface Builder 中创建的,并且我创建了一个单独的本地化 XIB,以
我在 View 中放置了一个 UIDatePicker,UIDatePicker 没有正确响应触摸 - 只有最右边的列/滚轮滚动 UIDatePicker 中的所有触摸。这与 View 中发生触摸的位
我有一个非常奇怪和令人困惑的问题。我找不到任何关于它的信息,它似乎是 Apple 的一个错误,但如果有人对如何解决这个问题有建议,那将会很有帮助。某些日期使用 UIDatePicker 将年份加 1,
在我的应用程序中,当用户单击 UITextField 时,应该会弹出 UIDatePicker。但是,它没有弹出。当我运行它时,它只显示“选择日期!”在行动表上,没有别的。 这是我的 ViewCont
我有一个 UIDatePicker,我希望将最小和最大日期范围设置为本周的星期四到星期三之间,我该如何设置?选择器日期是日期选择器,日期选择器文本字段是文本字段 pickerDate.datePick
我尝试设置最小和最大日期来限制用户的选择,但它不起作用: override func viewDidLoad() { let datePickerView : UIDatePi
func show(title: String, doneButtonTitle: String = "Done", cancelButtonTitle: String = "Cancel", def
我是一名优秀的程序员,十分优秀!