restkit和iso date [英] restkit and iso date

查看:119
本文介绍了restkit和iso date的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我要恢复的iso日期字符串是2011-,因此我无法从我的json api / mongodb中解析一个iso日期。 11-15T04:00:00Z,它不会转换成我的对象中的nsdate,显示为null。



如果我无法格式化,推荐的工作是什么我的日期字符串,服务器端在api?

解决方案

在Google群组中查看此信息



http://groups.google.com/group/restkit / browse_thread / thread / 5ffaa4626209881



看起来你必须创建自己的日期格式化程序并将其添加到对象映射器


I'm having trouble parsing an iso date from my json api/mongodb using rest kit.

The iso date string I'm getting back is "2011-11-15T04:00:00Z" whichdoesn't get converted to an nsdate in my object, showing as null.

What's the recommended work around if I can't format my date string, server side at the api?

解决方案

Saw this post in google groups

http://groups.google.com/group/restkit/browse_thread/thread/5ffaa4626209881

Looks like you would have to create your own date formatter and add it to the object mapper

这篇关于restkit和iso date的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆