所以我有以下代码,它分割街道、城镇、州、国家、邮编并创建一个 AddressAnnotation,这是我从注释扩展而来的一个类。
有时所有图钉都显示在地图上,有时它找不到某些地方,尽管它每次都是完全相同地址的集合。谷歌地图有时但不是一直都能找到一个地方有什么原因吗?
它在我的代码中吗?
谢谢,R
for (int i=0; i < [places count]-1; ++i) {
NSArray *arrayPlace = [[places objectAtIndex:i] componentsSeparatedByString:@"***"];
AddressAnnotation *addAnnotation = [[AddressAnnotation alloc] initWithCoordinate:
[self getLocationFromAddressString:
[NSString stringWithFormat:
@"%@ %@ %@ %@ %@ %@",
[arrayPlace objectAtIndex:3],
[arrayPlace objectAtIndex:4],
[arrayPlace objectAtIndex:5],
[arrayPlace objectAtIndex:6],
[arrayPlace objectAtIndex:7],
[arrayPlace objectAtIndex:8]]]];
[addAnnotation setWebsite:[arrayPlace objectAtIndex:2]];
[addAnnotation setTitle:[arrayPlace objectAtIndex:0]];
[addAnnotation setSubtitle:[arrayPlace objectAtIndex:1]];
[mapView addAnnotation:addAnnotation];
}