我想从地理编码器值向 NSMutableArray 添加纬度和经度值,但图像中出现错误。
-(void) loadDataArray:(NSString *) text{
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:[NSString stringWithFormat:@"%@",text] completionHandler:^(NSArray* placemarks, NSError* error){
for (CLPlacemark* aPlacemark in placemarks)
{
NSLog(@"aPlace: %@",aPlacemark.country);
NSLog(@"MyPlace: %@",userCountry);
//if ([aPlacemark.country isEqual:userCountry]) {
[dataArray addObject:aPlacemark];
//NSNumber *lat = [NSNumber numberWithDouble:aPlacemark.location.coordinate.latitude];
//NSNumber *lon= [NSNumber numberWithDouble:aPlacemark.location.coordinate.longitude];
[dataArrayLat addObject:aPlacemark.location.coordinate.latitude];
[dataArrayLon addObject:aPlacemark.location.coordinate.longitude];
//NSLog(@" %@",lat);
//}
//else{
// NSLog(@"Bulunamadı");
//}
}
[searchTable reloadData];
}];
}
感谢回复。
编辑
我想用于搜索位置并显示 tableview。我选择 tableview 项目,然后在 Apple Map 上显示位置。