2015-04-02 63 views
0

我有一個奇怪的問題,我無法讓這種方法做任何事情!我已經添加了地圖視圖委託,並在頂部AND頭文件中取消了委託。我打算只得到迴應,當用戶觸摸通過點擊谷歌地圖標記谷歌地圖iOS SDK didTapInfoWindowOfMarker不能正常工作

這裏產生的液泡是我

#import "ViewController.h" 
#import "Location.h" 

@interface ViewController() <GMSMapViewDelegate> 

@property(nonatomic)NSMutableArray* storedLocations; 
@property(nonatomic)NSMutableArray* myPlaces; 

@end 

@implementation ViewController { 

GMSMapView *mapView; 

} 

- (void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker  *)marker{ 

UIAlertView* new = [[UIAlertView alloc] initWithTitle:@"Nice!" message:@"Good stuff" delegate:self cancelButtonTitle:@"Well Done!" otherButtonTitles:nil]; 
[new show]; 


} 

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    // Create Map View on scene with camera 
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:0 
                 longitude:0 
                  zoom:0]; 
    mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; 
    mapView.myLocationEnabled = YES; 
    self.view = mapView; 
    mapView.delegate = self; 

截至此刻提到,觸摸泡沫什麼都不做

回答

0

也許你必須定義一個標題,

mapView.title = @"Test title"; 

,那麼你可以在描述窗口點擊。