ios - 更新 iPad 8.3 版后的日期格式问题
<p><p>更新 iPad 8.3 版后的日期格式问题下面的代码返回 NIL 值,但在模拟器和 iPod 中工作正常</p>
<pre><code>-(NSString *)dateFormat:(NSString *)str{
NSDateFormatter *dateFormatter = [ init];
;
NSDate *dateFromString = [ init];
dateFromString = ;
//problem here when i call this method from simulator and ipod it runsperfectly
//and returns2015-01-27 00:27:48 +0000 but in case of IPad(iOS 8.3) it return NIL
NSDateFormatter* df = [ init];
;
;
NSString* myString = ;
return myString;
}
//code to call above method with date string which are return from web service
;
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>检查输入字符串日期格式。 <br/> 应该是这样的格式: - <code>yyyy/MM/dd HH:mm:ss zzz</code> </p></p>
<p style="font-size: 20px;">关于ios - 更新 iPad 8.3 版后的日期格式问题,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/30252155/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/30252155/
</a>
</p>
页:
[1]