From db82df19eb7b14e06ea5941afdcbee7fb0fd1e4a Mon Sep 17 00:00:00 2001 From: Jeremy Mack Date: Mon, 5 Sep 2011 22:59:09 -0300 Subject: [PATCH] Fixed a few typos and formatting errors. Added a space before a numbered list so Markdown would properly format it. --- Docs/Object Mapping.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Docs/Object Mapping.md b/Docs/Object Mapping.md index 1c16c976..6accf1be 100644 --- a/Docs/Object Mapping.md +++ b/Docs/Object Mapping.md @@ -499,6 +499,7 @@ articleMapping.primaryKeyAttribute = @"articleID"; ``` The astute reader will notice a couple of things: + 1. We changed our inheritance to NSManagedObject from NSObject 1. Our properties are now implemented via @dynamic instead of @synthesize 1. We have added a new property -- articleID. Typically when you load a remote object it is going to include a unique @@ -535,7 +536,7 @@ We might have a User class like the following: @end ``` -You will note that this JSON is problematic compared to our earlier examples because the `email` attribute's data +You will note that this JSON is problematic compared to our earlier examples because the `username` attribute's data exists as the key in a dictionary, rather than a value. We handle this by creating an object mapping and using a new type of mapping definition: @@ -543,7 +544,7 @@ type of mapping definition: RKObjectMapping* mapping = [RKObjectMapping mappingForClass:[User class]]; [mapping mapKeyOfNestedDictionaryToAttribute:@"username"]; [mapping mapFromKeyPath:@"(username).email" toAttribute:"email"]; -[mapping mapFromKeyPath:@"(username).favoriteAnimal" toAttribute:"favoriteAnimal"]; +[mapping mapFromKeyPath:@"(username).favorite_animal" toAttribute:"favoriteAnimal"]; ``` What happens with this type of object mapping is that when applied against a dictionary of data,