3

I am trying to make a marker's window clickable so it can lead to a new view

From previous stackoverflow answers, they have said to use

-(UIView*)mapView:(GMSMapView *)mapView markerInfoWindow:(id<GMSMarker>)marker {


}

However, when I use the method, xcode says "Cannot find protocol declaration for GMSMarker" and highlights

(id<GMSMarker>)

How would I solve this problem?

4

1 回答 1

2

没有像 GMSMarker 这样的协议。也没有像文档-(UIView*)mapView:(GMSMapView *)mapView markerInfoWindow:(id<GMSMarker>)marker中那样的方法。

GMSMarker是一个类,而不是一个协议。现有方法- (UIView *) mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker将指向GMSMarker对象的指针作为第二个参数,而不是符合 GMSMarker 协议的对象。

于 2013-07-03T08:40:55.633 回答