2012-06-14 27 views
0

我有一个UITableView与自定义UITableViewCells,大部分时间当他们被触摸,didSelectRowAtIndexPath:被调用,并推出一个新的视图。但是,有时以特定方式点击(点按并保持约一秒钟),它们将保持高亮显示,并且不会推动下一个视图,直到在屏幕上的其他任何位置检测到另一个点击。我试图在didSelectRowAtIndexPath内记录一条消息:并确认它没有在这些情况下被调用。该方法中的代码是:自定义UITableViewCells偶尔保持突出显示,不推动下一个视图

PortfolioVC *portfolioController = [self.storyboard instantiateViewControllerWithIdentifier:@"portfolioIdentifier"]; 
AccountInformationVC *accountController = [self.storyboard instantiateViewControllerWithIdentifier:@"accountIdentifier"]; 
[[Globals Variables] setIndex:indexPath.row]; 

if (indexPath.section == 0) 
    [self.navigationController pushViewController:accountController animated:YES]; 
if (indexPath.section == 1) 
    [self.navigationController pushViewController:portfolioController animated:YES]; 

的高亮显示的图像是由selectedBackground连接到包含高亮显示的图像的的UIImageView设置XIB的自定义的UITableViewCell内。

回答

0

我修正了这个问题。我不得不在自定义单元格xib中重新连接背景UIImageViews。这样做后,清理构建,并删除应用程序,问题已修复。我也曾尝试覆盖自定义UITableViewCells中的setSelected和setHighlighted方法,并删除了这些方法。