我有一个服务器的响应“经度和纬度”,我也可以显示它到细胞。但我需要显示地址,而不是经度和纬度。我该怎么做呢?
以下是响应:
015-12-06 12:54:45.593 smartschool[249:11801] Item latitude_: 14.937681666666666
2015-12-06 12:54:45.593 smartschool[249:11801] Item longitude_: 121.02107833333334我使用以下方法显示单元格的经度和纬度:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"TableIdentifier";
AppDelegate *appDelegate = [_child_info objectAtIndex:indexPath.row];
Child *cell = (Child *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Child" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.childLoclong.text = appDelegate.longitude;
cell.childLoclat.text = appDelegate.latitude;
return cell;
}发布于 2015-12-06 18:59:14
使用此GET请求链接:
http://maps.googleapis.com/maps/api/geocode/json?latlng=14.937681666666666,121.02107833333334&sensor=true_or_false
这里lat = 14.937681666666666,long = 121.02107833333334
这是返回一个json并解析这个json,您得到了formatted_address参数,也就是从lat-long中给出了地址。
使用它..
https://stackoverflow.com/questions/34114257
复制相似问题