iPhone 3G 支持 NSDateFormatters 吗?

发布于 2024-12-09 11:13:16 字数 998 浏览 0 评论 0原文

我的 iPhone 应用程序有日期选择器选项。它在 3GS 及以上的 iPhone 设备上运行良好。但是,日期选择器在 iPhone 3G 中有时会崩溃。我在日期选择器“完成”按钮中使用了一些NSDateFormatters。我认为 NSDateFormatter 不支持 3G。任何人都可以建议 3G 中可用/支持的 NSDateFormatters 吗?下面我提到了一些我在代码中使用的NSDateFormatters。请帮我解决这个问题。

[outputFormatter setDateFormat:@"hh:mm:ss"];
[outputFormatterT setDateFormat:@"hh:mm:ssa"];
[outputFormatter1 setDateFormat:@"h:mm aaa"];

NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setDateFormat:@"hh:mm:ss"]; NSDateFormatter *outputFormatterT = [[NSDateFormatter alloc] init]; [outputFormatterT setDateFormat:@"hh:mm:ssa"]; NSString *timeStrT = [outputFormatterT stringFromDate:[timePicker 日期]]; NSDateFormatter *outputFormatter1 = [[NSDateFormatter alloc] init]; outputFormatter1 setDateFormat:@"h:mm aaa"]; NSString *str = [outputFormatter1 stringFromDate:[timePicker 日期]];

而且我也使用了 stringAppendingString 格式,我无法复制崩溃问题。提前致谢。请编辑我的问题。

My iphone application having the Date Picker option. It is working fine in 3GS and above iphone devices. But, Date picker is some times getting crash in iPhone 3G. I have used some NSDateFormatters in Date Picker 'Done' button. I think the NSDateFormatter is not supporting in 3G. Can anyone suggest the available/supporting NSDateFormatters in 3G? Below i have mentioned some NSDateFormatters that i has used in my code. Please help me to solve this problem.

[outputFormatter setDateFormat:@"hh:mm:ss"];
[outputFormatterT setDateFormat:@"hh:mm:ssa"];
[outputFormatter1 setDateFormat:@"h:mm aaa"];

NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"hh:mm:ss"];
NSDateFormatter *outputFormatterT = [[NSDateFormatter alloc] init];
[outputFormatterT setDateFormat:@"hh:mm:ssa"];
NSString *timeStrT = [outputFormatterT stringFromDate:[timePicker date]];
NSDateFormatter *outputFormatter1 = [[NSDateFormatter alloc] init];
outputFormatter1 setDateFormat:@"h:mm aaa"];
NSString *str = [outputFormatter1 stringFromDate:[timePicker date]];

and also i has used stringAppendingString format also, i cant replicate the crashing issue. Thanks in advance. Please edit my question.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆追雨的时光 2024-12-16 11:13:16

感谢您与我一起度过宝贵的时间。我已经找到了我的问题的答案。问题是,当用户将时间格式更改为 24 小时时,应用程序在所有手机(3g、3gs 及以上)中都会崩溃。我再次感谢大家。

Thanks for spending your valuable time with me. I have found an answer for my question. The problem is when the user change their Time Format to 24 hours the app is getting crash in all mobiles (3g, 3gs and above). Once again i thank you all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文