Inherits from NSObject
Declared in RKMapping.h

Overview

RKMapping is an abstract class for objects defining RestKit object mappings. Its interface is common to all object mapping classes, including its concrete subclasses RKObjectMapping and RKDynamicMapping.

Tasks

Forcing Collection Mapping

  •   forceCollectionMapping

    Forces the mapper to treat the mapped keyPath as a collection even if it does not return an array or a set of objects. This permits mapping where a dictionary identifies a collection of objects.

    property

Comparing Mappings

Properties

forceCollectionMapping

@property (nonatomic, assign) BOOL forceCollectionMapping
Discussion

Forces the mapper to treat the mapped keyPath as a collection even if it does not return an array or a set of objects. This permits mapping where a dictionary identifies a collection of objects.

When enabled, each key/value pair in the resolved dictionary will be mapped as a separate entity. This is useful when you have a JSON structure similar to:

 { "users": {
    "blake":  { "id": 1234, "email": "blake@restkit.org" },
    "rachit": { "id": 5678, "email": "rachit@restkit.org" }
    }
 }

By enabling forceCollectionMapping, RestKit will map “blake” => attributes and “rachit” => attributes as independent objects. This can be combined with mapKeyOfNestedDictionaryToAttribute: to properly map these sorts of structures.

@default NO

Declared In

RKMapping.h

Instance Methods

isEqualToMapping:

- (BOOL)isEqualToMapping:(RKMapping *)otherMapping
Discussion

Returns YES if the receiver and the specified mapping are considered equivalent.

NOTE: Must be implemented in subclass.

Declared In

RKMapping.h