-(void)tapCell:(UITapGestureRecognizer *)gestureRecognizer{
CGPoint location = [gestureRecognizer locationInView:tableView];
NSIndexPath *indexPath = [tableView indexPathForRowAtPoint:location];
if(indexPath.row == [appDelegate.users count]){
[self performSegueWithIdentifier:@"StartToCreateUser" sender:self];
}else if(indexPath){
NSLog(@"ELSE IF TAP");
NSLog(@"location: %f , %f", location.x, location.y);
self.imageView.image = [UIImage imageNamed:@"swipe_gray"];
self.imageView.center = CGPointMake(location.x, location.y+96+20);
self.imageView.alpha = 1;
[UIView animateWithDuration:1.2 animations:^{self.imageView.alpha=0;}];
}
}
我的问题是,在第一次点击时,UIImageView没有显示。第一次点击后一切正常。如果在第一次点击时调用else(因此indexPath不是nil),每次点击的位置都是相同的。 UIImageView在第一次点击时没有显示。我正在拔毛,任何帮助都非常感谢!:)