Created
September 26, 2011 19:01
-
-
Save mladjan/1243051 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://10.0.1.4:3000"]; | |
RKObjectMapping* busesMapping = [RKObjectMapping mappingForClass:[Autobus class]]; | |
[busesMapping mapKeyPath:@"model" toAttribute:@"model"]; | |
[busesMapping mapKeyPath:@"tour_id" toAttribute:@"tourId"]; | |
[busesMapping mapKeyPath:@"seat" toAttribute:@"seats"]; | |
[busesMapping mapKeyPath:@"bus_number" toAttribute:@"busNumber"]; | |
[busesMapping mapKeyPath:@"created_at" toAttribute:@"createdAt"]; | |
[busesMapping mapKeyPath:@"updated_at" toAttribute:@"updatedAt"]; | |
[busesMapping mapKeyPath:@"registar_number" toAttribute:@"registarNumber"]; | |
[busesMapping mapKeyPath:@"id" toAttribute:@"busId"]; | |
[busesMapping mapKeyPath:@"longitude" toAttribute:@"long"]; | |
[busesMapping mapKeyPath:@"latitude" toAttribute:@"lat"]; | |
[objectManager.mappingProvider setMapping:busesMapping forKeyPath:@"buses"]; | |
params = [NSDictionary dictionaryWithObjectsAndKeys: @"2011-08-16", @"datum", @"TRUE", @"fromSerbia", nil]; | |
[objectManager.client URLForResourcePath:@"/service/getLocations.json" queryParams:params]; | |
[objectManager loadObjectsAtResourcePath:@"/service/getLocations.json" delegate:self]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NSURL *someURL = [objectManager.client URLForResourcePath:@"/service/getLocations.json" queryParams:params];
[objectManager loadObjectsAtResourcePath:[someURL absoluteString] delegate:self];