Besi
Besi

Reputation: 22939

Mapping with XML and RestKit

Since I upgraded RestKit and started using cocoapods my old mapping ceases to work since all the values are now nested in a dictionary.

Is there a more elegant way to do a RestKit mapping for XML (I am aware that JSON is the main line of attack for RestKit but XML is not going to disappear anytime soon either.

Mapping before updating

[mapping mapAttributes:@"username", @"password", @"firstName", @"lastName", nil];

Mapping now with the .text suffixes

[mapping mapKeyPath:@"username.text" toAttribute:@"username"];
[mapping mapKeyPath:@"firstName.text" toAttribute:@"firstName"];
[mapping mapKeyPath:@"lastName.text" toAttribute:@"lastName"];

My Podfile

platform :ios, '6.0'

pod 'RestKit', '0.10.3'
pod 'RestKit/ObjectMapping/XML', '0.10.3'

Upvotes: 1

Views: 614

Answers (1)

T0m_Twt
T0m_Twt

Reputation: 623

Use the 0.20.0 version of RestKit.

A wiki is available : https://github.com/RestKit/RestKit/wiki/Upgrading-from-v0.10.x-to-v0.20.0

Upvotes: 2

Related Questions