iPhone 3G 支持 NSDateFormatters 吗?
我的 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢您与我一起度过宝贵的时间。我已经找到了我的问题的答案。问题是,当用户将时间格式更改为 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.