tapOnCalloutAccessoryControl delegate method not getting called on acessory view tap in mapbox mapview

680 views Asked by At

I am working on my app using mapbox sdk(MapBox iOS SDK 1.0.3) and installed the framework using steps as described here.

Now when i add the annotation on the map then i am able to show the title,subtitle,left/right accessory views but the accessory view's tap functionality is not working.

I have tried these solutions as described in these discussions but still i am not able to get tap functionality to work on my left and right accessory view and its driving me nuts to why this is happening as this is just a basic functionality.I have read a lot of discussions in mapbox support and tried most of the solutions but to no use.

Please help me on where i am getting wrong.i have looked into this project too- "weekend-pics".but i am not understanding why these two methods -

- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation

and

- (void)tapOnCalloutAccessoryControl:(UIControl *)control forAnnotation:(RMAnnotation *)annotation onMap:(RMMapView *)map

are not being called directly on the contrary the should be called as these are delegate methods and should be triggered when accesory view of callout is tapped.

I have tried using [self mapView:mapView layerForAnnotation:annotations]; then i get the compiler to go into this mehtod-

- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation

but still the - - (void)tapOnCalloutAccessoryControl:(UIControl *)control forAnnotation:(RMAnnotation *)annotation onMap:(RMMapView *)map method doesnot gets called when i try to click on the right accesory view of the annotation.

I have added #import "MapBox/MapBox.h" in my file. do i need to add any other file too for this functionality to work? and i have debugged using Breakpoints but the control never goes inside these two methods as described above.

  1. I am using Mbtile file and using it as an offline map in my app.
  2. Xcode5,ios7 Please guys help me solve this issue.Thanks!!
1

There are 1 answers

3
incanus On BEST ANSWER

Are you sure that you are setting your mapView.delegate? These are delegate callback methods. You can do this either in code or in the XIB, if you add your map view that way.