Permalink
Browse files

Working around the fact that the inverseMapping function does not ret…

…ain date formatters from the original mapper. RestKit#1058

Signed-off-by: Levi Brown <levi@grokers.net>
  • Loading branch information...
1 parent 27880b3 commit eda6402688175d060512791169a114dfb5125c90 Levi Brown committed Dec 6, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 Code/Additions/ObjectMapper.m
@@ -64,6 +64,9 @@ + (NSDictionary *)dictionaryFromMappableObject:(id <MappableObject>)mappableObje
RKObjectMapping *mapping = [[mappableObject class] objectMapping];
RKObjectMapping *inverseMapping = [mapping inverseMapping];
+ //Preserve the date formatters from the original mapping object
+ inverseMapping.preferredDateFormatter = mapping.preferredDateFormatter;
+ inverseMapping.dateFormatters = mapping.dateFormatters;
if (inverseMapping == nil)
{
RKLogWarning(@"No mapping available for class '%@'.", [mappableObject class]);

0 comments on commit eda6402

Please sign in to comment.