Declared in RKParser.h

Overview

The RKParser protocol declares two methods that a class must implement so that it can provide support for parsing and serializing object representations to the RestKit framework. Parsers are required to transform data to and from string representations and are configured via the RKParserRegistry shared instance.

Tasks

  • – objectFromString:error:

    Returns an object representation of the source string encoded in the format provided by the parser (i.e. JSON, XML, etc).

    required method
  • – stringFromObject:error:

    Returns a string representation encoded in the format provided by the parser (i.e. JSON, XML, etc) for the given object.

    required method

Instance Methods

objectFromString:error:

Returns an object representation of the source string encoded in the format provided by the parser (i.e. JSON, XML, etc).

- (id)objectFromString:(NSString *)string error:(NSError **)error

Parameters

string

The string representation of the object to be parsed.

error

A pointer to an NSError object.

Return Value

The parsed object or nil if an error occurred during parsing.

Declared In

RKParser.h

stringFromObject:error:

Returns a string representation encoded in the format provided by the parser (i.e. JSON, XML, etc) for the given object.

- (NSString *)stringFromObject:(id)object error:(NSError **)error

Parameters

object

The object to be serialized.

A

pointer to an NSError object.

Return Value

A string representation of the serialized object or nil if an error occurred.

Declared In

RKParser.h