touchesBegan事件在大量滚动后停止射击

时间:2010-10-11 08:42:12

标签: iphone uiview uiviewcontroller

我在水平ScrollView中显示了一系列UITableView。在每个tableview中,每个TableViewCell包含2个缩略图块,表示详细视图。我正在使用touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event来捕获其中一个图块被点击时。从那里,我将详细视图推送到NavigationController并显示不同的屏幕。加载初始视图时,此交互有效。但是,如果您快速上下滚动任何表视图,touchesBegan事件将停止触发。在此期间没有收到任何内存警告。

这是我在视图控制器内部使用的代码,它接收到tap(tableviewcell里面的一个小区块:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    NSLog(@"Touched received on ArticleTileViewController");
    ArticleViewController *vc = [[ArticleViewController alloc] initWithArticleData:self.articleDataArray];
    ProjectAppDelegate *appDelegate = (ProjectAppDelegate *)[UIApplication sharedApplication].delegate;

    [appDelegate.navController pushViewController:vc animated:YES]; 
}

编辑:我也尝试过touchesEnded,同样的行为结果。

我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我通过切换到使用UITapGestureRecognizer解决了这个问题。实施快捷方便!!