我写个iphone程序,想实现单击MKMapView弹出另一个视图,不用手势识别,怎么捕获MKMapView的touchesBegan事件。我是在UIview上添加了一个MKMapView,运行程序,单击MKMapView的时候,touchesBegan没有被调用啊,改怎么解决呢
------解决方案--------------------
- C/C++ code
// 1、在viewDidLoad中添加我们要捕获的手势: UITapGestureRecognizer *mTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapPress:)]; [_mapView addGestureRecognizer:mTap]; [mTap release];- (void)tapPress:(UIGestureRecognizer*)gestureRecognizer { //用做啥自己写在这里}