Due to some changes in the api, the place mark we get from
[place resolveToPlacemark:^(CLPlacemark *placemark, NSString *addressString, NSError *error)
block is different now, and there is lot of changes in placemark. so is there any other way to get the latitude and longitude from clplacemark,
i can get latitude and longitude but its too long way by dictionary to dictionary checking. my previous code which is working is following
[place resolveToPlacemark:^(CLPlacemark *placemark, NSString *addressString, NSError *error) {
if (error)
SPPresentAlertViewWithErrorAndTitle(error, @"Error while getting location");
}
else if (placemark)
{
id objtest = placemark;
NSString *str = [NSString stringWithFormat:@"%@",objtest];
NSArray *chunks = [str componentsSeparatedByString: @";"];
if (chunks.count >1)
{
NSString *lat = [chunks objectAtIndex:0];
NSString *lng = [chunks objectAtIndex:1];
selectedLatitude = [[lat componentsSeparatedByString:@"\""] objectAtIndex:1];
selectedLongitude = [[lng componentsSeparatedByString:@"\""] objectAtIndex:1];
}
else{
selectedLatitude = [NSString stringWithFormat:@"%f",placemark.location.coordinate.latitude];
selectedLongitude = [NSString stringWithFormat:@"%f",placemark.location.coordinate.longitude];
}
NSLog(@"selected latitude : %@",selectedLatitude);
NSLog(@"selected longitude : %@",selectedLongitude);
}
else{
NSLog(@"Anything other...");
}
}];
}
Due to some changes in the api, the place mark we get from
[place resolveToPlacemark:^(CLPlacemark *placemark, NSString *addressString, NSError *error)
block is different now, and there is lot of changes in placemark. so is there any other way to get the latitude and longitude from clplacemark,
i can get latitude and longitude but its too long way by dictionary to dictionary checking. my previous code which is working is following