我有一个MKMapView,我正在添加这样的注释:
for (NSDictionary *tmp in response)
{
NSDictionary *places = [tmp objectForKey:@"place"];
NSDictionary *location = [places objectForKey:@"location"];
NSLog(@"long: %@ Lat:%@",[location objectForKey:@"longitude"], [location objectForKey:@"latitude"]);
float longitude = [[location objectForKey:@"longitude"] floatValue];
float latitude = [[location objectForKey:@"latitude"] floatValue];
CLLocationCoordinate2D locationco = {latitude,longitude};
NSString *titleString = [tmp objectForKey:@"name"];
Place *pin = [[Place alloc] init];
pin.coordinate = locationco;
pin.title = titleString;
pin.subtitle = @"A Location";
//NSArray *annots = [[NSArray alloc] initWithObjects:pin, nil];
//[map addAnnotations:annots];
[map addAnnotation:pin];
[[map viewForAnnotation:pin] setCanShowCallout:YES];
}
Run Code Online (Sandbox Code Playgroud)
本MKAnnotation的显示在地图上罚款,我可以选择它们,但是没有出现标注泡沫.我知道他们正在被选中 …