KeyPath & forResourcePathPattern in ObjectMapping

39 views
Skip to first unread message

Antoine Bisson

unread,
Nov 13, 2012, 4:30:11 PM11/13/12
to res...@googlegroups.com
Good afternoon everyone,

So I have been looking for this function that Blake supposedly pushed to origin something like a month ago:

- (void)setObjectMapping:(RKObjectMappingDefinition *) forResourcePathPattern:(NSString*) keyPath:(NSString *)

Right now I need to have some sort of keyPaths since my JSON response from Tastypie is {meta:{}, objects{}} (so I need "objects"). I don't understand how to use this function:

[omp setObjectMapping:cellMapping forResourcePathPattern:@"/cells/?format=json" withFetchRequestBlock: to replace the behavior that I want, and the function mentioned in the first paragraph is not in my RestKit API. According to CocoaPods, I am at version Using RestKit (0.10.3) defaulting to JSON subspec.

If it is not released yet, how can I set a KeyPath, as well as a forResourcePathPattern?!

Thanks a lot!


Blake Watters

unread,
Nov 13, 2012, 7:52:01 PM11/13/12
to res...@googlegroups.com
You should use the development branch instead of 0.10.x. It's quite mature and has been gated on getting a release version tagged due to my focus being consumed with product development work on GateGuru.

On the development branch, mappings are configured using RKResponseDescriptor objects. You can configure a mapping by path pattern, key path, and response status code type and any combination there-of.

You can install the development branch via CocoaPods as well. Check out the details on: https://github.com/RestKit/RestKit/tree/development

We are about to ship GateGuru 3.0 and I'll get a proper release for RestKit out the door shortly.

Antoine Bisson

unread,
Nov 13, 2012, 9:02:21 PM11/13/12
to res...@googlegroups.com
Hey Blake,

Thanks for the quick answer. I am wondering how to update to 0.2 via CocoaPods? I looked at the link you sent me... but I am very new to CocoaPods as well. Thank God it exists though... the amount of trouble it has saved me, omg!

Thanks again!

Antoine Bisson

unread,
Nov 13, 2012, 9:06:09 PM11/13/12
to res...@googlegroups.com
Nevermind got it!

Thanks!
Reply all
Reply to author
Forward
0 new messages