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"));
}
精彩评论