두 번 호출 된 UISwipeGestureRecognize에 문제가 있습니다. 탭이 4 개있는 tabbarcontroller 기반 응용 프로그램을 만들었습니다. 해당 UIViewController 아래에있는 UINavigationController 갖는 각 탭, 거기에 세 번째 탭에서 코드 아래에 impelemented있다. 난 [self.tabBarController setSelectedIndex:0]
제어 라인에 도달 할 때, 그것은 "didSwipeLeft"를 호출 시뮬레이터 와이프 남아 않는UISwipeGestureRecognizer가 두 번 호출 되었습니까?
UISwipeGestureRecognizer *swipeLeft =[[UISwipeGestureRecognizer alloc]
initWithTarget:self action:@selector(didSwipeLeft:)];
swipeLeft.direction=UISwipeGestureRecognizerDirectionLeft;
swipeLeft.numberOfTouchesRequired = 1;
[self.view addGestureRecognizer:swipeLeft];
[swipeLeft release];
- (void) didSwipeLeft:(UISwipeGestureRecognizer *)sender {
NSLog(@"Left..");
if ((sender.state == UIGestureRecognizerStateEnded)) {
[self.tabBarController setSelectedIndex:0];
}
}
다시 호출 함수 (didSwipeLeft). 제발 도와주세요, 문제를 해결하는 방법, 누군가가 동일한 문제에 직면 해있다. 미리 감사드립니다.
같은 문제가 있습니다! – ToddH