したがって、次のコードは、通り、町、州、国、郵便番号を分割し、注釈から拡張したクラスである AddressAnnotation を作成します。
すべてのピンがマップに表示されることもあれば、場所の一部が見つからないこともありますが、毎回まったく同じ住所のコレクションです。Google マップが時々場所を見つけることができるが、常にではない理由はありますか?
それは私のコードに何かありますか?
ありがとう、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];
}