Nextrek
Diff Revisions
587
vs
588
for /iOS/SafariArte/trunk/SafariArte/Network/NXTParser.m
|
@@ -27,13 +27,7 @@ |
27 |
27 |
|
for (NSDictionary *dictionary in response[@"response"][@"routes"]) { |
28 |
28 |
|
SFAPercorso *percorso = [SFAPercorso alloc]; |
29 |
29 |
|
|
30 |
|
- |
//--------------------------------------------------------------------------------------------------------------------------------------------// |
31 |
|
- |
//--------------------------------------------------------------------------------------------------------------------------------------------// |
32 |
|
- |
// FABRIZIO |
33 |
30 |
|
percorso.routePois = [NSMutableArray array]; |
34 |
|
- |
//--------------------------------------------------------------------------------------------------------------------------------------------// |
35 |
|
- |
//--------------------------------------------------------------------------------------------------------------------------------------------// |
36 |
|
- |
|
37 |
31 |
|
|
38 |
32 |
|
percorso.routeId = (NSString*)[dictionary valueForKey:@"r_id"]; |
39 |
33 |
|
percorso.routeLabel = (NSString*)[dictionary valueForKey:@"r_label"]; |
|
@@ -53,7 +47,10 @@ |
53 |
47 |
|
percorso.coordLatitudeDx = (NSString*)[dictionary valueForKey:@"re_coord_lat_dx"]; |
54 |
48 |
|
percorso.coordLongitudeSx = (NSString*)[dictionary valueForKey:@"re_coord_lon_sx"]; |
55 |
49 |
|
percorso.coordLongitudeDx = (NSString*)[dictionary valueForKey:@"re_coord_lon_dx"]; |
56 |
|
- |
percorso.distanceToUser = [DATAMANAGER setRouteLength:[dictionary valueForKey:@"r_dist"]]; |
|
50 |
+ |
|
|
51 |
+ |
if ([dictionary valueForKey:@"r_dist"]) { |
|
52 |
+ |
percorso.distanceToUser = [DATAMANAGER setDistanceToMe:[dictionary valueForKey:@"r_dist"]]; |
|
53 |
+ |
} |
57 |
54 |
|
|
58 |
55 |
|
percorso.routePrice = (NSString*)[dictionary valueForKey:@"r_price"]; |
59 |
56 |
|
percorso.routePurchased =([[dictionary valueForKey:@"r_purchased"] boolValue]==YES) ? YES : NO; |
|
@@ -64,8 +61,8 @@ |
64 |
61 |
|
percorso.urDetails = (NSString*)[dictionary valueForKey:@"ur_details"]; |
65 |
62 |
|
percorso.urScore = (NSString*)[dictionary valueForKey:@"ur_score"]; |
66 |
63 |
|
percorso.urStatus = [[dictionary objectForKey:@"urStatus"] integerValue]; |
|
64 |
+ |
|
67 |
65 |
|
|
68 |
|
- |
|
69 |
66 |
|
// AGGIUNTO PER AVERE ETICHETTE PERCORSI UGUALI SIA UN PERCORSI GRATUITI CHE IN I MIEI PERCORSI |
70 |
67 |
|
for (NSDictionary *dict in dictionary[@"poi"] ) { |
71 |
68 |
|
|
|
@@ -87,7 +84,7 @@ |
87 |
84 |
|
|
88 |
85 |
|
[percorso.routePois addObject:routePOI]; |
89 |
86 |
|
} |
90 |
|
- |
|
|
87 |
+ |
|
91 |
88 |
|
[resultDictionary setObject:percorso forKey:percorso.routeId]; |
92 |
89 |
|
|
93 |
90 |
|
[DATAMANAGER.orderedArray insertObject:percorso.routeId atIndex:n]; |
|
@@ -115,6 +112,13 @@ |
115 |
112 |
|
route.routeLabel = (NSString*)[dictionary valueForKey:@"r_label"]; |
116 |
113 |
|
route.routeMap = (NSString*)[dictionary valueForKey:@"r_map"]; |
117 |
114 |
|
route.routeLength = [DATAMANAGER setRouteLength:[dictionary valueForKey:@"r_length"]]; |
|
115 |
+ |
|
|
116 |
+ |
if ([dictionary valueForKey:@"r_dist"]) { |
|
117 |
+ |
|
|
118 |
+ |
route.distanceToUser = [DATAMANAGER setDistanceToMe:[dictionary valueForKey:@"r_dist"]]; |
|
119 |
+ |
|
|
120 |
+ |
} |
|
121 |
+ |
|
118 |
122 |
|
route.routeEnable = ([[dictionary valueForKey:@"r_enable"] boolValue]==YES) ? YES : NO; |
119 |
123 |
|
|
120 |
124 |
|
route.routeFileImg = (NSString*)[dictionary valueForKey:@"r_file_image"]; |