didClickCalloutAccessoryButtonForGraphic not being called

379
3
07-12-2011 05:47 AM
RickJones
Occasional Contributor II
I am using a View-based map project, in XCode 3 with v1.8 of the ESRI library.

The MapViewController is not receiving the didClickCalloutAccessoryButtonForGraphic event, even though the delegates are all set. Another project almost identical, the event fires.
Here are some snippets:


@interface MonctonMapViewController : UIViewController <AGSIdentifyTaskDelegate, AGSMapViewLayerDelegate,
                                                        AGSMapViewTouchDelegate, UINavigationControllerDelegate,
                                                        AGSMapViewCalloutDelegate, AGSInfoTemplateDelegate>

...
- (void)viewDidLoad {
    [super viewDidLoad];

// setup the location controller
self.mapView.gps.autoPan = YES;


self.tolerance = [[NSNumber alloc] initWithInt:1];
self.featuresSucceeded = 0;

//set the map view delegate
// self.mapView.mapViewDelegate = self;
self.mapView.touchDelegate = self;
self.mapView.layerDelegate = self;
self.mapView.calloutDelegate = self;
self.mapView.showMagnifierOnTapAndHold = YES;
...
   //show callout
   [self.mapView showCalloutAtPoint:self.mapPoint];
...  

//show the attributes if accessory button is clicked
- (void)mapView:(AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic:(AGSGraphic *)graphic {

UIAlertView *info = [[UIAlertView alloc] initWithTitle:@"Alert"];
[info show];
[info release];
0 Kudos
3 Replies
RickJones
Occasional Contributor II
It seems the documentation for 1.8 no longer exists for me to check.

Is it safe to upgrade to 2.0?
0 Kudos
NimeshJarecha
Esri Regular Contributor
Yes, it is safe to upgrade to 2.0. 🙂

Since, you are showing a callout with showCalloutAtPoint, you should check the delegate method  didClickCalloutAccessoryButtonAtPoint: and NOT didClickCalloutAccessoryButtonForGraphic.

Regards,
Nimesh
0 Kudos
RickJones
Occasional Contributor II
Thank you, that worked.
0 Kudos