Skip to content

Instantly share code, notes, and snippets.

@bobspryn
Created April 29, 2012 20:57
Show Gist options
  • Select an option

  • Save bobspryn/2553234 to your computer and use it in GitHub Desktop.

Select an option

Save bobspryn/2553234 to your computer and use it in GitHub Desktop.
GetProductList Obj-C
RKObjectMapping* productMapping = [RKObjectMapping mappingForClass:[CWProduct class]];
[productMapping mapKeyPathsToAttributes:@"Product.Id", @"productId", @"Product.ProductCode", @"productCode", @"Product.Name", @"name", @"Product.Description", @"descriptionText", @"Product.IsInBox", @"isInBox", @"Product.QtyInBox", @"quantityInBox", @"Product.Images", @"images", @"Product.Videos", @"videos", @"Product.Attributes", @"attributes", @"Product.Link", @"link", @"Product.Rating", @"rating", nil];
productMapping.rootKeyPath = @"Products";
// curl -XPOST -d "mid=4" http://feeds.clubw.com.asp1-1.dfw1-2.websitetestlink.com/mobile.svc/GetProductList
[objectManager.mappingProvider setObjectMapping:productMapping forResourcePathPattern:@"/mobile.svc/GetProductList"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment