0

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!

F.SO3
  • 237
  • 1
  • 3
  • 9

1 Answers1

0

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.

Community
  • 1
  • 1
gaskbr
  • 368
  • 3
  • 12
  • You're welcome :) I filed this issue to google: https://code.google.com/p/gmaps-api-issues/issues/detail?id=9664 – gaskbr May 02 '16 at 14:08