AGSGraphic *graphic;
AGSPoint *graphicPoint;
NSMutableDictionary *graphicAttributes;
AGSPictureMarkerSymbol *graphicSymbol;
//Graphic for demonstrating custom callout with buttons
graphicPoint = [AGSPoint pointWithX:sample.latitude y:sample.longitude spatialReference:self.mapView.spatialReference];
graphicAttributes=[[NSMutableDictionary alloc]initWithCapacity:3];
[graphicAttributes setObject:[NSString stringWithFormat:@"%d",sample.sampleId] forKey:@"SampleID"];
[graphicAttributes setObject:mapData.SurveyData forKey:@"SurveyData" ];
NSLog(@"%@",[graphicAttributes objectForKey:@"SurveyData"]);
NSLog(@"%@", [graphicAttributes allKeys]);
graphicSymbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"MapPin_Blue.png"];
graphic = [AGSGraphic graphicWithGeometry:graphicPoint symbol:graphicSymbol attributes:graphicAttributes infoTemplateDelegate:self];
NSLog(@"%@", [[graphic allAttributes] allKeys]);
[self.graphicsLayer addGraphic:graphic];
日志单独提供键 Allkeys SampleID
,没有得到SurveyData
,which is an NSArray
! 为什么会这样?