Inherits from NSObject
Conforms to RKObjectMappable
Declared in RKObject.h
RKObject.m

Overview

Base class for non-managed RestKit mappable objects.

Tasks

Other Methods

Other Methods

Other Methods

Other Methods

  • + object

    Must return a new autoreleased instance of the model class ready for mapping. Used to initialize the model via any method other than alloc & init.

Other Methods

  • – propertiesForSerialization

    Return a dictionary of values to be serialized for submission to a remote resource. The router will encode these parameters into a serialization format (form encoded, JSON, etc). This is required to use putObject: and postObject: for updating and creating remote object representations.

Other Methods

  • – relationshipsForSerialization

    Return a dictionary of relationships to be serialized for submission to a remote resource. The router will encode these parameters into a serialization format (form encoded, JSON, etc). This is required to use putObject: and postObject: for updating and creating remote object representations.

Class Methods

elementToPropertyMappings

Must return a dictionary containing mapping from JSON element names to property accessors

+ (NSDictionary *)elementToPropertyMappings

Declared In

RKObjectMappable.h

elementToRelationshipMappings

Must return a dictionary mapping JSON element names to related object accessors. Must return an empty dictionary if there are no related objects.

+ (NSDictionary *)elementToRelationshipMappings

Discussion

When assigning a collection of related objects, use key-value coding to traverse the collection and access the descendent objects. For example, given a Project object associated with a user and a collection of tasks:

[NSDictionary dictionaryWithObject:@“user” forKey:@“user”]; Will map from an element named ‘user’ to the user property on the model instance.

[NSDictionary dictionaryWithObject:@“tasks” forKey:@“tasks.task”]; Will map each ‘task’ element nested under a containing element named ‘tasks’ and assign the collection to the tasks property on the target object. The assigned collection is assumed to be an NSSet.

Declared In

RKObjectMappable.h

object

Must return a new autoreleased instance of the model class ready for mapping. Used to initialize the model via any method other than alloc & init.

+ (id)object

Declared In

RKObjectMappable.h

relationshipsToSerialize

Must return an array containing names of relationship properties to serialize

+ (NSArray *)relationshipsToSerialize

Declared In

RKObjectMappable.h

Instance Methods

propertiesForSerialization

Return a dictionary of values to be serialized for submission to a remote resource. The router will encode these parameters into a serialization format (form encoded, JSON, etc). This is required to use putObject: and postObject: for updating and creating remote object representations.

- (NSDictionary *)propertiesForSerialization

Declared In

RKObjectMappable.h

relationshipsForSerialization

Return a dictionary of relationships to be serialized for submission to a remote resource. The router will encode these parameters into a serialization format (form encoded, JSON, etc). This is required to use putObject: and postObject: for updating and creating remote object representations.

- (NSDictionary *)relationshipsForSerialization

Declared In

RKObjectMappable.h