touchesEnd没有被称为bit touchesBegin和touchesMoved被调用

Ted*_*tel 2 ios

我试图在ios中拖延.如果拖动移动距离很短,我会将拖动计为点击事件,方法是将开始x,y(来自touchesBegan)与touchesEnd中的x,y进行比较.似乎touchesEnd永远不会被调用.我给了一个断点来验证它并且断点从未消失.

code:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    NSUInteger touchCount = [touches count];
    NSUInteger tapCount = [[touches anyObject] tapCount];

    [ self UpdateDrag];

   }

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    NSUInteger touchCount = [touches count];
    NSUInteger tapCount = [[touches anyObject] tapCount];

    }


- (void) touchesEnd:(NSSet *)touches withEvent:(UIEvent *)event {
   // this methes never gets called 
    NSUInteger touchCount = [touches count];
    NSUInteger tapCount = [[touches anyObject] tapCount];


    if (mDisplay==nil)
    {
        mDisplay = [[cDisplayYesOrNo_iPhone alloc]
                    initWithNibName:@"cDisplayYesOrNo_iPhone"
                    bundle:[NSBundle mainBundle]];
    }
    [ mDisplay SetUp];
    [self presentModalViewController: mDisplay animated:NO];


}
Run Code Online (Sandbox Code Playgroud)