Hi Forum,
i want to see if anyone can please explain the difference between these two methods for me. I have read the apple docs over and over again but i do not understand the difference. So here is my code... in my view controller i have
and in my view class i have the method "tripleTapToAdjustOrigin" and in it i have
when i use locationInView it works perfectly, if i use locationOfTouch:0 inView:self also works, but picking any number other than 0 , like 1 or 2 crashes my program. My (incomplete) understanding is that the index determines which touch we are interested it....so how does it really work? i will really appreciate the help.
i want to see if anyone can please explain the difference between these two methods for me. I have read the apple docs over and over again but i do not understand the difference. So here is my code... in my view controller i have
Code:
UITapGestureRecognizer *tripleTapToAdjustOrigin = [[UITapGestureRecognizer alloc]
initWithTarget:self.graphview
action:@selector(tripleTapToAdjustOrigin:)];
tripleTapToAdjustOrigin.numberOfTapsRequired = 3;
[self.graphview addGestureRecognizer:tripleTapToAdjustOrigin];
and in my view class i have the method "tripleTapToAdjustOrigin" and in it i have
Code:
- (void)tripleTapToAdjustOrigin:(UITapGestureRecognizer *)gesture
{
if((gesture.state == UIGestureRecognizerStateEnded))
{
self.axisOrigin = [gesture locationInView:self];
}
}
when i use locationInView it works perfectly, if i use locationOfTouch:0 inView:self also works, but picking any number other than 0 , like 1 or 2 crashes my program. My (incomplete) understanding is that the index determines which touch we are interested it....so how does it really work? i will really appreciate the help.