iOS Google Maps SDK,无法收听GMSMarker点击事件

我坚持使用适用于iOS的GoogleMaps SDK …
我想在Google地图上点击GMSMarker时添加一些function,但它不起作用。 有什么不对?

FirstController.h

#import  #import  #import  #import "sqlite3.h" @interface FirstViewController : UIViewController  { sqlite3 *db; } 

FirstController.m

 [...] -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { camera = [GMSCameraPosition cameraWithLatitude:newLocation.coordinate.latitude longitude:newLocation.coordinate.longitude zoom:(12)]; mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; mapView_.myLocationEnabled = YES; for(GMSMarker *currentMarker in _locationMarkers) { currentMarker.map = mapView_; } self.view = mapView_; } -(BOOL) mapView:(GMSMapView *) mapView didTapMarker:(GMSMarker *)marker { NSLog(@"try"); return YES; } 

在您创建地图后,我认为您可能需要这样:

 mapView_.delegate = self;