O'Reilly logo

RestKit for iOS by Taras Kalapun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Metadata mapping

The mapping operation provides support for mapping a dictionary of metadata in addition to the source object. This metadata is made available by mapping key paths nested under a specially designated parent key (@metadata) that cannot exist in a source representation. The metadata is also nested under subkeys to effectively namespace usage between components. An example of metadata mapping would be getting an object index from the collection it came from. To do so, we can write the following code:

 [mapping addAttributeMappingsFromDictionary:@{
  @"@metadata.mapping.collectionIndex": @"index"
}];

The @metadata prefix indicates that the property is to be mapped from the metadata dictionary instead of from the source object representation. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required