Solved! Go to Solution.
<AGSMapViewLayerDelegate> <AGSMapViewCalloutDelegate> < AGSMapViewTouchDelegate>
// Set the Layer Delegate self.mapView.layerDelegate = self; // Set the Callout Delegate self.mapView.calloutDelegate = self; // Set the Touch Delegate self.mapView.touchDelegate = self; //-----------------Create and Add Feature Layer------------------------- NSURL* myUrl = [NSURL URLWithString: @"<place feature service URL here>"]; AGSFeatureLayer* myLayer = [AGSFeatureLayer featureServiceLayerWithURL: myUrl mode: AGSFeatureLayerModeOnDemand]; // Add My Dynamic Feature Layer to Map View [self.mapView addMapLayer:myLayer withName:@"My Layer"]; // Create Info Template Delegate for My Dynamic Feature Layer AGSCalloutTemplate* myTemplate = [[AGSCalloutTemplate alloc] init] ; myTemplate.titleTemplate = @"${Field Value for Title Text}"; myTemplate.detailTemplate = @"${Field Value for Detail Text}"; // Assign Template to My Dynamic Feature Layer myLayer.infoTemplateDelegate = myTemplate;
<AGSMapViewLayerDelegate> <AGSMapViewCalloutDelegate> < AGSMapViewTouchDelegate>
// Set the Layer Delegate self.mapView.layerDelegate = self; // Set the Callout Delegate self.mapView.calloutDelegate = self; // Set the Touch Delegate self.mapView.touchDelegate = self; //-----------------Create and Add Feature Layer------------------------- NSURL* myUrl = [NSURL URLWithString: @"<place feature service URL here>"]; AGSFeatureLayer* myLayer = [AGSFeatureLayer featureServiceLayerWithURL: myUrl mode: AGSFeatureLayerModeOnDemand]; // Add My Dynamic Feature Layer to Map View [self.mapView addMapLayer:myLayer withName:@"My Layer"]; // Create Info Template Delegate for My Dynamic Feature Layer AGSCalloutTemplate* myTemplate = [[AGSCalloutTemplate alloc] init] ; myTemplate.titleTemplate = @"${Field Value for Title Text}"; myTemplate.detailTemplate = @"${Field Value for Detail Text}"; // Assign Template to My Dynamic Feature Layer myLayer.infoTemplateDelegate = myTemplate;
self.myfeatureLayer.outFields = [NSArray arrayWithObject:@"*"];
In addition to those steps, it is crucial to add this line of code when you create the feature layer, in order to get all the outfields available:self.myfeatureLayer.outFields = [NSArray arrayWithObject:@"*"];