Nextrek
@ 74
Nextrek / iOS / Location / NetService.m
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
// // NetService.m // // Created by - // Copyright 2010. All rights reserved. // #import "NetService.h" #import "ASIFormDataRequest.h" @implementation NetService @synthesize oldVersion; static NetService *instance; +(NetService *) getInstance { if (!instance) { instance = [[NetService alloc] init]; } return instance; } - (id) init { if((self = [super init])) { instance = self; } return self; } #pragma mark - #pragma mark GET_LOCATOR - (void) getLocator:(id)aDelegate mapItem:(MapItem*)aMapItem loc:(NSString *)loc lat:(NSString *)lat lon:(NSString *)lon { // NSURL *url = [NSURL URLWithString:@"TEST"]; NSString *mapParam = [aMapItem.richiesta stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/geocode/xml?address=%@", mapParam]]; // LOG_INFO_X(@"GOOGLESERVICE: %@", GOOGLESERVICE); // LOG_INFO_X(@"aMapItem.richiesta: %@", aMapItem.richiesta); // LOG_INFO_X(@"URL: %@", url); ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; // [request setPostValue:loc forKey:@"loc"]; // [request setPostValue:lat forKey:@"lat"]; // [request setPostValue:lon forKey:@"lon"]; [request setDelegate:aDelegate]; [request setDidFinishSelector:@selector(getLocatorRequestDone:)]; [request setDidFailSelector:@selector(getLocatorRequestWentWrong:)]; // [request setNumberOfTimesToRetryOnTimeout:2]; [request startAsynchronous]; } @end |
Commits for Nextrek/iOS/Location/NetService.m
Revision | Author | Commited | Message |
---|---|---|---|
63 | FAquili | Sat 18 Jan, 2014 16:59:40 +0000 | Parcheggio Roma 1.0 |