I am trying to get the location after a long press to dray an overlay around that location. However, the action I set on the long press is not firing.
-(void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
//add the long press options
//single finger long press
UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(getMapCoordinateFromTouch:)];
[longPressGesture setNumberOfTouchesRequired:1];
longPressGesture.delegate = self;
[self.mapview addGestureRecognizer:longPressGesture];
//double finger long press
UILongPressGestureRecognizer *doubleLongPressGesture = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(removeBoundry:)];
[doubleLongPressGesture setNumberOfTouchesRequired:2];
doubleLongPressGesture.delegate = self;
[self.mapview addGestureRecognizer:doubleLongPressGesture];
and here is the function it calls
-(void)getMapCoordinateFromTouch:(UILongPressGestureRecognizer *) gesture{
if(gesture.state == UIGestureRecognizerStateBegan){
CGPoint touchlocation = [gesture locationInView:self.mapview];
pressedloc = [self.mapview convertPoint:touchlocation toCoordinateFromView:self.mapview];
[self createBundarywithRadius:.1];
}