Permalink
Browse files

Some methods name changed.

  • Loading branch information...
1 parent 3f56ecc commit cd0c53ed62a1d9793475b99050718235682e34fb @kishikawakatsumi committed Aug 13, 2009
View
@@ -59,10 +59,10 @@ - (void)goolgeMapsAPI:(UICGoogleMapsAPI *)goolgeMapsAPI didGetObject:(NSObject *
NSArray *routeDics = [dictionary objectForKey:@"routes"];
routes = [[NSMutableArray alloc] initWithCapacity:[routeDics count]];
for (NSDictionary *routeDic in routeDics) {
- [(NSMutableArray *)routes addObject:[UICGRoute routeWithDictionary:routeDic]];
+ [(NSMutableArray *)routes addObject:[UICGRoute routeWithDictionaryRepresentation:routeDic]];
}
self.geocodes = [dictionary objectForKey:@"geocodes"];
- self.polyline = [UICGPolyline polylineWithDictionary:[dictionary objectForKey:@"polyline"]];
+ self.polyline = [UICGPolyline polylineWithDictionaryRepresentation:[dictionary objectForKey:@"polyline"]];
self.distance = [dictionary objectForKey:@"distance"];
self.duration = [dictionary objectForKey:@"duration"];
self.status = [dictionary objectForKey:@"status"];
@@ -20,7 +20,7 @@ @implementation UICGDirectionsOptions
- (id)init {
self = [super init];
if (self != nil) {
- locale = [[NSLocale currentLocale] retain];
+ locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ja_JP"];
travelMode = UICGTravelModeDriving;
avoidHighways = NO;
getPolyline = YES;
View
@@ -10,19 +10,20 @@
#import <CoreLocation/CoreLocation.h>
@interface UICGPolyline : NSObject {
- NSDictionary *dictionary;
+ NSDictionary *dictionaryRepresentation;
NSArray *vertices;
NSMutableArray *routePoints;
NSInteger vertexCount;
NSInteger length;
}
-@property (nonatomic, readonly) NSMutableArray *routePoints;
+@property (nonatomic, retain, readonly) NSDictionary *dictionaryRepresentation;
+@property (nonatomic, retain, readonly) NSMutableArray *routePoints;
@property (nonatomic, readonly) NSInteger vertexCount;
@property (nonatomic, readonly) NSInteger length;
-+ (UICGPolyline *)polylineWithDictionary:(NSDictionary *)dic;
-- (id)initWithDictionary:(NSDictionary *)dic;
++ (UICGPolyline *)polylineWithDictionaryRepresentation:(NSDictionary *)dictionary;
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary;
- (CLLocation *)vertexAtIndex:(NSInteger)index;
- (void)insertVertexAtIndex:(NSInteger)index inLocation:(CLLocation *)location;
View
@@ -10,21 +10,22 @@
@implementation UICGPolyline
+@synthesize dictionaryRepresentation;
@synthesize routePoints;
@synthesize vertexCount;
@synthesize length;
-+ (UICGPolyline *)polylineWithDictionary:(NSDictionary *)dic {
- UICGPolyline *polyline = [[UICGPolyline alloc] initWithDictionary:dic];
++ (UICGPolyline *)polylineWithDictionaryRepresentation:(NSDictionary *)dictionary {
+ UICGPolyline *polyline = [[UICGPolyline alloc] initWithDictionaryRepresentation:dictionary];
return [polyline autorelease];
}
-- (id)initWithDictionary:(NSDictionary *)dic {
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary {
self = [super init];
if (self != nil) {
- dictionary = [dic retain];
+ dictionaryRepresentation = [dictionary retain];
- vertices = [[dictionary objectForKey:@"j"] retain];
+ vertices = [[dictionaryRepresentation objectForKey:@"j"] retain];
vertexCount = [vertices count];
routePoints = [NSMutableArray arrayWithCapacity:vertexCount];
for (NSDictionary *vertex in vertices) {
@@ -38,7 +39,7 @@ - (id)initWithDictionary:(NSDictionary *)dic {
}
- (void)dealloc {
- [dictionary release];
+ [dictionaryRepresentation release];
[vertices release];
[super dealloc];
}
View
@@ -11,7 +11,7 @@
#import "UICGStep.h"
@interface UICGRoute : NSObject {
- NSDictionary *dictionary;
+ NSDictionary *dictionaryRepresentation;
NSInteger numerOfSteps;
NSArray *steps;
NSDictionary *distance;
@@ -23,6 +23,7 @@
NSInteger polylineEndIndex;
}
+@property (nonatomic, retain readonly) NSDictionary *dictionaryRepresentation;
@property (nonatomic, readonly) NSInteger numerOfSteps;
@property (nonatomic, retain, readonly) NSArray *steps;
@property (nonatomic, retain, readonly) NSDictionary *distance;
@@ -33,8 +34,8 @@
@property (nonatomic, retain, readonly) CLLocation *endLocation;
@property (nonatomic, assign, readonly) NSInteger polylineEndIndex;
-+ (UICGRoute *)routeWithDictionary:(NSDictionary *)dic;
-- (id)initWithDictionary:(NSDictionary *)dic;
++ (UICGRoute *)routeWithDictionaryRepresentation:(NSDictionary *)dictionary;
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary;
- (UICGStep *)stepAtIndex:(NSInteger)index;
@end
View
@@ -10,6 +10,7 @@
@implementation UICGRoute
+@synthesize dictionaryRepresentation;
@synthesize numerOfSteps;
@synthesize steps;
@synthesize distance;
@@ -20,25 +21,25 @@ @implementation UICGRoute
@synthesize endLocation;
@synthesize polylineEndIndex;
-+ (UICGRoute *)routeWithDictionary:(NSDictionary *)dic {
- UICGRoute *route = [[UICGRoute alloc] initWithDictionary:dic];
++ (UICGRoute *)routeWithDictionaryRepresentation:(NSDictionary *)dictionary {
+ UICGRoute *route = [[UICGRoute alloc] initWithDictionaryRepresentation:dictionary];
return [route autorelease];
}
-- (id)initWithDictionary:(NSDictionary *)dic {
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary {
self = [super init];
if (self != nil) {
- dictionary = [dic retain];
- NSDictionary *k = [dictionary objectForKey:@"k"];
+ dictionaryRepresentation = [dictionary retain];
+ NSDictionary *k = [dictionaryRepresentation objectForKey:@"k"];
NSArray *stepDics = [k objectForKey:@"Steps"];
numerOfSteps = [stepDics count];
steps = [[NSMutableArray alloc] initWithCapacity:numerOfSteps];
for (NSDictionary *stepDic in stepDics) {
- [(NSMutableArray *)steps addObject:[UICGStep stepWithDictionary:stepDic]];
+ [(NSMutableArray *)steps addObject:[UICGStep stepWithDictionaryRepresentation:stepDic]];
}
- endGeocode = [dictionary objectForKey:@"MJ"];
- startGeocode = [dictionary objectForKey:@"dT"];
+ endGeocode = [dictionaryRepresentation objectForKey:@"MJ"];
+ startGeocode = [dictionaryRepresentation objectForKey:@"dT"];
distance = [k objectForKey:@"Distance"];
duration = [k objectForKey:@"Duration"];
@@ -54,7 +55,7 @@ - (id)initWithDictionary:(NSDictionary *)dic {
}
- (void)dealloc {
- [dictionary release];
+ [dictionaryRepresentation release];
[steps release];
[distance release];
[duration release];
View
@@ -10,21 +10,22 @@
#import <CoreLocation/CoreLocation.h>
@interface UICGStep : NSObject {
- NSDictionary *dictionary;
+ NSDictionary *dictionaryRepresentation;
CLLocation *location;
NSInteger polylineIndex;
NSString *descriptionHtml;
NSDictionary *distance;
NSDictionary *duration;
}
-@property (nonatomic, retain, readonly)CLLocation *location;
+@property (nonatomic, retain, readonly) NSDictionary *dictionaryRepresentation;
+@property (nonatomic, retain, readonly) CLLocation *location;
@property (nonatomic, readonly) NSInteger polylineIndex;
@property (nonatomic, retain, readonly) NSString *descriptionHtml;
@property (nonatomic, retain, readonly) NSDictionary *distance;
@property (nonatomic, retain, readonly) NSDictionary *duration;
-+ (UICGStep *)stepWithDictionary:(NSDictionary *)dic;
-- (id)initWithDictionary:(NSDictionary *)dic;
++ (UICGStep *)stepWithDictionaryRepresentation:(NSDictionary *)dictionary;
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary;
@end
View
@@ -10,43 +10,44 @@
@implementation UICGStep
+@synthesize dictionaryRepresentation;
@synthesize location;
@synthesize polylineIndex;
@synthesize descriptionHtml;
@synthesize distance;
@synthesize duration;
-+ (UICGStep *)stepWithDictionary:(NSDictionary *)dic {
- UICGStep *step = [[UICGStep alloc] initWithDictionary:dic];
++ (UICGStep *)stepWithDictionaryRepresentation:(NSDictionary *)dictionary {
+ UICGStep *step = [[UICGStep alloc] initWithDictionaryRepresentation:dictionary];
return [step autorelease];
}
-- (id)initWithDictionary:(NSDictionary *)dic {
+- (id)initWithDictionaryRepresentation:(NSDictionary *)dictionary {
self = [super init];
if (self != nil) {
- dictionary = [dic retain];
+ dictionaryRepresentation = [dictionary retain];
- NSDictionary *point = [dictionary objectForKey:@"Point"];
+ NSDictionary *point = [dictionaryRepresentation objectForKey:@"Point"];
NSArray *coordinates = [point objectForKey:@"coordinates"];
CLLocationDegrees latitude = [[coordinates objectAtIndex:0] doubleValue];
CLLocationDegrees longitude = [[coordinates objectAtIndex:1] doubleValue];
location = [[[CLLocation alloc] initWithLatitude:latitude longitude:longitude] autorelease];
- id index = [dictionary objectForKey:@"polylineIndex"];
+ id index = [dictionaryRepresentation objectForKey:@"polylineIndex"];
if (index == [NSNull null]) {
polylineIndex = -1;
} else {
polylineIndex = [index integerValue];
}
- descriptionHtml = [dictionary objectForKey:@"descriptionHtml"];
- distance = [dictionary objectForKey:@"Distance"];
- duration = [dictionary objectForKey:@"Duration"];
+ descriptionHtml = [dictionaryRepresentation objectForKey:@"descriptionHtml"];
+ distance = [dictionaryRepresentation objectForKey:@"Distance"];
+ duration = [dictionaryRepresentation objectForKey:@"Duration"];
}
return self;
}
- (void)dealloc {
- [dictionary release];
+ [dictionaryRepresentation release];
[location release];
[descriptionHtml release];
[distance release];

0 comments on commit cd0c53e

Please sign in to comment.