2

I have a custom calloutview for my map. There is a tableview inside. Until IOS 6 everything works fine and if I selected a row a new view was displayed inside the callout but now with IOS 6 it does not work anymore. The tableview is shown but I can't select a row just scroll the table. Any idea how to solve this problem?

thx 4 help!

kev52
  • 151
  • 1
  • 1
  • 5
  • if I add an accessory it works - but just for the buttonTap the cell will not be selected. Any other touch is working, just the selection is a problem - don't know what's the problem. Even other Apps with similar functionality have this problem I think! – kev52 Sep 24 '12 at 08:51

1 Answers1

0

I resolved this problem. Click anything in CalloutView,the map will not get touch.My calloutview is custom have tabbleview

1 - In file MapviewController.h you will add delegate : UIGestureRecognizerDelegate

2 - and in file MapViewController.m implement method - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

-In my mapView when you click 1 time on Map it will go in this method 3 time. So I limit touch will action.the first touch will action. - In myCalloutView have tabbleView, if tabbleView receive touch It will return false touch for Map, it will make your tabbleview can get touch.It same for your button

Note : in NSlog hit test View : will have name of view item you want it have touch. example my view : isEqualToString:@"UITableViewCellContentView"]

static int count=0;
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
        NSLog(@"hit test view %@",[touch view]);    
        if(count >0 && count<=2)
        {
            count++;
            count=count%2;
            return FALSE;
        }
        count++;      
        if ([[[[touch view] class] description] isEqualToString:@"UITableViewCellContentView"]) {
            return FALSE;
        }
        return TRUE;
    }
THT
  • 51
  • 1
  • 2