Skip to content

Commit

Permalink
Update DCNSURLConverter.m
Browse files Browse the repository at this point in the history
Make it work with urls with spaces
  • Loading branch information
qizh committed Feb 13, 2014
1 parent 70f817d commit 50b6517
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion KeyValueObjectMapping/DCNSURLConverter.m
Expand Up @@ -16,7 +16,7 @@ + (DCNSURLConverter *) urlConverter {
}

- (id)transformValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute dictionary:(NSDictionary *)dictionary parentObject:(id)parentObject {
return [NSURL URLWithString:value];
return [NSURL URLWithString:[value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
- (id)serializeValue:(id)value forDynamicAttribute:(DCDynamicAttribute *)attribute {
return [((NSURL *)value) absoluteString];
Expand Down

0 comments on commit 50b6517

Please sign in to comment.