I am putting markers on a mapView. The markers are showing objects from a NSArray populated from JSON. Now, if the user taps on a marker, it opens an info window which shows text from two fields (keys) from the array. What I need is to put a button inside the info windows. If the user taps on the button, a detail viewController including more information about the selected object must be opened.
This is the code that puts the markers on the mapView:
for ( int i=0;i<[categorias count];i++){
GMSMarker *marker = [[GMSMarker alloc] init];
double latitud = [[[categorias objectAtIndex:i] objectForKey:@"latitudEmpresa"] doubleValue];
double longitud = [[[categorias objectAtIndex:i] objectForKey:@"longitudEmpresa"]doubleValue];
marker.position = CLLocationCoordinate2DMake(latitud, longitud);
NSString *nombre = [[categorias objectAtIndex:i] objectForKey:@"nombreEmpresa"];
marker.title = nombre;
NSString *direccion = [[categorias objectAtIndex:i] objectForKey:@"direccionEmpresa"];
marker.snippet = direccion;
marker.map = mapView_;
}