当我调用重载数据时,第二次传递相同的directGestire函数。 如何更正tableView?
-(void)directGesture:(UISwipeGestureRecognizer *)gesture{
if (gesture.state == UIGestureRecognizerStateEnded) {
NSLog(@"Get gesture");
[self.tableView beginUpdates];
[[self displayedObjects] removeObjectAtIndex:2];
[self.tableView endUpdates];
//have a problem second pass
[self.tableView reloadData];
}
}
答案 0 :(得分:0)
- (void)directGesture:(UISwipeGestureRecognizer *)gesture{
if (gesture.enabled) {
//code here
}
//блокировка гестуры
// NSLog(@"gesture.enabled 1 = %@\n", (gesture.enabled ? @"YES" : @"NO"));
gesture.enabled = NO;
// NSLog(@"gesture.enabled 2 = %@\n", (gesture.enabled ? @"YES" : @"NO"));
//[gesture setDirection:UISwipeGestureRecognizerDirectionUp] ;
[self.tableView reloadData];
gesture.enabled = YES;
//NSLog(@"gesture.enabled 3 = %@\n", (gesture.enabled ? @"YES" : @"NO"));
}