I need to know how to get BSJSON to handle the NSDate that is in coredata
in the json it returns null for the date, what needs to go into the category to make this work?
I need to know how to get BSJSON to handle the NSDate that is
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you’re talking about http://github.com/blakeseely/bsjsonadditions, there’s really no easy way to get a JSON object and dump it into NSDate. You need some intervening logic – like asserting a common date format, and then do the NSDate <-> String conversion yourself, and letting the JSON format represent the string.
Common methods for doing this are to use “# of seconds since Epoch” to represent the time, or to just fully qualify out an ISO-8601 time string. Which is easier often depends on what other systems you’re working with and which they can easily convert and use. The first is accomplished super-easy with Objective-C by using NSDate dateWithTimeIntervalSince1970:
Going in and out of an ISO-8601 string is a bit more work, and you’ll head into the realm of NSDateFormatter