我是 iphone 开发的新手,我想在 mapview 中显示地址。我目前正在使用CLLocationManager
.
我正在使用这种方法:
-(NSString *)getAddressFromLatLon:(double)pdblLatitude
withLongitude:(double)pdblLongitude
{
NSString *urlString = [NSString stringWithFormat:kGeoCodingString,pdblLatitude, pdblLongitude];
NSError* error;
NSString *locationString = [NSString stringWithContentsOfURL:
[NSURL URLWithString:urlString]
encoding:NSASCIIStringEncoding
error:&error];
locationString = [locationString stringByReplacingOccurrencesOfString:@"\"" withString:@""];
NSLog(@"%@",locationString);
return [locationString substringFromIndex:6];
}
然后我传递这个值:
[self getAddressFromLatLon:37.484848 withLongitude:74.48489];
但是,我不知道我的地址。