-(ID) Initwithcoordinate :(Cllocationcoordinate2d) Coordinate {
If(Self= [Super Init]) {
// Custom Initialization
Reversegeocoder= [[Mkreversegeocoder Alloc]Initwithcoordinate: Coordinate];
Reversegeocoder.Delegate=Self;
[Reversegeocoder Start];
//Zookeeper
}
Return Self;
}
# Pragma mark mkreversegeocoderdelegate
-(Void) Reversegeocoder :(Mkreversegeocoder*) Geocoder didfailwitherror :(Nserror*) Error
{
Nsstring* Errormessage = [ErrorLocalizeddescription];
Uialertview* Alertview = [[Uialertview Alloc]Initwithtitle:@"An error occurred while obtaining details."
Message: Errormessage
Delegate:Nil
Cancelbuttontitle:@ "OK"
Otherbuttontitles:Nil];
[AlertviewShow];
[AlertviewRelease];
}
-(Void) Reversegeocoder :(Mkreversegeocoder*) Geocoder didfindplacemark :(Mkplacemark*) Placemark
{
Nslog(@ "% @", Placemark.Locality);
}
// ================================================ ========================
Street =Keyun Road18No.
Thoroughfare =Keyun Road
Subthoroughfare = 18No.
City =Guangzhou
Sublocality =Tianhe District
State =Guangdong
Subadministrativearea = (null)
Zip = (null)
Country =China
{
City ="Guangzhou";
Country ="China";
Countrycode = cn;
Formattedaddresslines =(
"China",
"Tianhe District, Guangzhou City, Guangdong Province",
"Keyun Road18No."
);
State ="Guangdong";
Street ="Keyun Road18No.";
Sublocality ="Tianhe District";
Subthoroughfare = "18No.";
Thoroughfare ="Keyun Road";
}
Mkplacemark:
@ Property(Nonatomic,Readonly) Nsdictionary * addressdictionary;//Address dictionary
@ Property(Nonatomic,Readonly) Nsstring * thoroughfare; //Street name-"keyun Road"
@ Property(Nonatomic,Readonly) Nsstring * subthoroughfare;// House number-- "18"
@ Property(Nonatomic,Readonly) Nsstring * locality; // City-"Guangzhou City"
@ Property(Nonatomic,Readonly) Nsstring * sublocality;// District/county-"Tianhe District"
@ Property(Nonatomic,Readonly) Nsstring * administrativearea; //Identity--"Guangdong"
@ Property(Nonatomic,Readonly) Nsstring * subadministrativearea;//I don't know what it is.
@ Property(Nonatomic,Readonly) Nsstring * postalcode; //Zip code--I don't know why. I didn't get it here.
@ Property(Nonatomic,Readonly) Nsstring * Country;//Country--"China"
@ Property(Nonatomic,Readonly) Nsstring * countrycode;//CountryCode-- "Cn"