This problem appears to be affecting a lot of objective-c developers working with custom built restful APIS -- like here and here. On the backend we are using ISO 6801 dates, and I've had trouble getting a valid date when I pull objects down from the server. This is the date format we use, but NSDate can't recognize it because the colon in the time zone offset:
1981-09-01T00:00:00-06:00
I've tried using this ISO6801 parser and unparser, which is included in the latest version of RestKit, but I can't figure out how to successfully add it to the object mapping. How do I add a date formatter to a RestKit objectmapping? Can anyone provide a code sample of how to do this?
Here is my failed code. This is what I'm looking for and tried based on a google groups post, but it gives errors:
[mapping.dateFormatStrings addObject:[[MyISO8601DateFormatter] alloc] init]];
There's a related answer on this post, but it is partly outdated and lacks a working example.