0

I'm creating an app that consists of a view controller and a MapView within it. I also added a longPressGestureRecognizer and connected it to an outlet and an action method that look like this:

- (IBAction)addPin:(UILongPressGestureRecognizer *)sender {

    //some code

}

The problem is that this method is never called, and I can't figure out why. I can clearly see that it really is connected to the gestureRecognizer. Why isn't it working?

I've done this:

  1. Added a MapView to my view controller in the StoryBoard.
  2. Added the longpressGestureRecognizer to the view controller in the storyboard.
  3. Connected the longPressRecognizer to an outlet.
  4. Connected the longPressRecognizer to the method described above.

I've read many other posts about this but nothing is working. A stränge thing is that the metod gets call when using an id-method.

Hank

iHank
  • 526
  • 9
  • 22
  • possible duplicate of [Can't Get Coordinates From MKMapView Using UILongTouchGestureRecognizer](http://stackoverflow.com/questions/13336650/cant-get-coordinates-from-mkmapview-using-uilongtouchgesturerecognizer) – Daij-Djan Mar 22 '14 at 13:05
  • see also : http://stackoverflow.com/questions/9700413/how-can-i-catch-tap-on-mapview-and-then-pass-it-to-default-gesture-recognizers?rq=1 – Daij-Djan Mar 22 '14 at 13:06
  • or 10th of others of answers -- if none solve it for you please be more concrete – Daij-Djan Mar 22 '14 at 13:06

0 Answers0