Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #203 from t089/master
Browse files Browse the repository at this point in the history
Fix wrong (reversed) usage of TTTISO8601DateTransformer
  • Loading branch information
mattt committed Jun 18, 2013
2 parents f0c6bb2 + 99295cf commit 0b1d783
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AFIncrementalStore/AFRESTClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ - (NSDictionary *)attributesForRepresentation:(NSDictionary *)representation
if ([(NSAttributeDescription *)obj attributeType] == NSDateAttributeType) {
id value = [mutableAttributes valueForKey:key];
if (value && ![value isEqual:[NSNull null]] && [value isKindOfClass:[NSString class]]) {
[mutableAttributes setValue:[[NSValueTransformer valueTransformerForName:TTTISO8601DateTransformerName] transformedValue:value] forKey:key];
[mutableAttributes setValue:[[NSValueTransformer valueTransformerForName:TTTISO8601DateTransformerName] reverseTransformedValue:value] forKey:key];
}
}
}];
Expand Down
2 changes: 1 addition & 1 deletion Examples/Twitter Client/Classes/AppDotNetAPIClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (NSDictionary *)attributesForRepresentation:(NSDictionary *)representation
NSMutableDictionary *mutablePropertyValues = [[super attributesForRepresentation:representation ofEntity:entity fromResponse:response] mutableCopy];
if ([entity.name isEqualToString:@"Post"]) {
[mutablePropertyValues setValue:[NSNumber numberWithInteger:[[representation valueForKey:@"id"] integerValue]] forKey:@"postID"];
[mutablePropertyValues setValue:[[NSValueTransformer valueTransformerForName:TTTISO8601DateTransformerName] transformedValue:[representation valueForKey:@"created_at"]] forKey:@"createdAt"];
[mutablePropertyValues setValue:[[NSValueTransformer valueTransformerForName:TTTISO8601DateTransformerName] reverseTransformedValue:[representation valueForKey:@"created_at"]] forKey:@"createdAt"];
} else if ([entity.name isEqualToString:@"User"]) {
[mutablePropertyValues setValue:[NSNumber numberWithInteger:[[representation valueForKey:@"id"] integerValue]] forKey:@"userID"];
[mutablePropertyValues setValue:[representation valueForKey:@"username"] forKey:@"username"];
Expand Down

0 comments on commit 0b1d783

Please sign in to comment.