0

I've followed the Google Maps Custom InfoWindows Video very closely and can't seem to get mine to work. Here is part of my viewcontroller.m:

GMSMarker *food = [[GMSMarker alloc] init];
food.position = CLLocationCoordinate2DMake(43.468725, 11.287411);
food.map = mapView_;
mapView_.mapType = kGMSTypeTerrain;
food.icon = [UIImage imageNamed:@"foodmarker"];

}
-(UIView *) mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)food
{

CustomInfoWindow *infoWindow = [[[NSBundle mainBundle] loadNibNamed:@"InfoWindow" owner:self options:nil] objectAtIndex:0];
infoWindow.name.text = @"FoodPlace";
infoWindow.address.text = @"Some kinda food location";
infoWindow.photo.image = [UIImage imageNamed: @"food"];
return infoWindow;
}

I get an error on return infoWindow saying: Incompatible pointer types returning 'CustomInfoWindow *' from a function with result type 'UIView *'

My CustomInfoWindow class is wired up to the Nib that will be displayed as the custom info window. The issue is that when I tap on the marker nothing happens or appears.

1 Answers1

0

I'm not sure about this but I think you can fix this by going to the Identify Inspector. This is the area on the right of XCode, third button from right. Or View->Utilities->Show Identity Inspector. At the top of identity inspector, you can set the custom class. Right now it is probably UIView. Set it instead to CustomInfoWindow.

Marc
  • 3,386
  • 8
  • 44
  • 68