Home finish revision, to make comments
iphone access to address details
-(ID) initwithcoordinate: (cllocationcoordinate2d) Coordinate {
if (self = [super init]) {
Custom initialization
Reversegeocoder = [[Mkreversegeocoder alloc] initwithcoordinate:coordinate];
Reversegeocoder.delegate = self;
[Reversegeocoder start];
......
}
return self;
}
#pragma Mark Mkreversegeocoderdelegate.
-(void) Reversegeocoder: (Mkreversegeocoder *) Geocoder didfailwitherror: (nserror *) error
{
NSString *errormessage = [Error localizeddescription];
Uialertview *alertview = [[Uialertview alloc] initwithtitle:@ ' Get details failed '
Message:errormessage
Delegate:nil
cancelbuttontitle:@ "OK"
Otherbuttontitles:nil];
[Alertview show];
[Alertview release];
}
-(void) Reversegeocoder: (Mkreversegeocoder *) Geocoder Didfindplacemark: (Mkplacemark *) placemark
{
NSLog (@ "%@", placemark.locality);
}
//=======================================================
Street = No. 18th, Ke Yun Road
Thoroughfare = Ke Yun lu
Subthoroughfare = No. 18th
City = Guangzhou
sublocality = Tianhe District
State = Guangdong Province
Subadministrativearea = (NULL)
ZIP = (NULL)
Country = China
{
City = "Guangzhou";
Country = "China";
CountryCode = CN;
Formattedaddresslines = (
"China",
"Guangzhou Tianhe District, Guangdong province",
"No. 18th, Ke Yun Road"
);
state = "Guangdong province";
Street = "Ke Yun Road No. 18th";
sublocality = "Tianhe District";
Subthoroughfare = "No. 18th";
thoroughfare = "Branch Rhyme Road";
}
Mkplacemark:
@property (nonatomic, readonly) nsdictionary *addressdictionary; Address dictionary
@property (nonatomic, readonly) NSString *thoroughfare; Street name--"Ke Yun Lu"
@property (nonatomic, readonly) NSString *subthoroughfare; Number--"18th"
@property (nonatomic, readonly) NSString *locality; City--"Guangzhou"
@property (nonatomic, readonly) NSString *sublocality; District and county--"Tianhe District"
@property (nonatomic, readonly) NSString *administrativearea; Identity--"Guangdong province"
@property (nonatomic, readonly) NSString *subadministrativearea; I didn't get it, I don't know what it was.
@property (nonatomic, readonly) NSString *postalcode; Zip code--I don't know why, but I don't get it here.
@property (nonatomic, readonly) NSString *country; Country--"China"
@property (nonatomic, readonly) NSString *countrycode; Country code--"CN"