Search code examples
iosobjective-ciphonecocoa-touchgoogle-maps-sdk-ios

GMSMarker infoWindow doesn't show and freeze application


I'm trying to load a UIView from a xib file to be my GMSMarker info window. I'm trying to do it like that:

-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
    //Creating "infoWindow"(infoWindow) and setting it with nib file called "infoWindow"
    CustomMarkerInfoWindow *infoWindow=[[[NSBundle mainBundle] loadNibNamed:@"CustomMarkerInfoWindow" owner:self options:nil] firstObject];

    //Setting "infoWindow"(infoWindow)'s storeNameLabel's text to "marker"(customMarker)'s title
    infoWindow.storeNameLabel.text=((customMarker*)marker).title;

    //Setting "infoWindow"(infoWindow)'s storeAddressLabel's text to marker's address
    infoWindow.storeAddressLabel.text=((customMarker*)marker).address;

    return infoWindow;
}

but when I click on a marker the info window doesn't show and all the app freezes (to start using it again I need to re-open it after I was killing it from the multitasking).

Note: if I do that this way it's all working fine (creating a regular UIView):

-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
    UIView *myView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
    myView.backgroundColor=[UIColor blueColor];

    return myView;
}

Anyone know why is it happening? I can't understand it for over a week!

I'll really appriciate if someone could help me here, thank you very much!


Solution

  • This is a duplicate of iOS app freezes when loading custom info window for marker on Google Maps

    It's a Google Maps version 1.13.0 bug. Downgrade your Google Maps SDK to 1.12.3 and everything will work.