2

iOSでドラッグしようとしています。ドラッグの動きが短距離の場合、(touchesBegan からの) 開始 x、y を 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];


}
4

2 に答える 2

6

では- (void)touchesEnded:ない- (void)touchesEnd:

https://developer.apple.com/library/ios/documentation/uikit/reference/UIResponder_Class/Reference/Reference.html#//apple_ref/occ/instm/UIResponder/touchesEnded:withEvent :

于 2013-09-17T19:17:10.890 に答える