开发者

reloadData call second function

When i call a reload data then second times pass same directGestire function. How to correct update 开发者_开发问答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];
     } 
  }


    - (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"));
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜