2011-12-02 76 views
2

所以我想捕捉以下行为在此确切顺序iOS的触摸事件(触摸收盘没有在合适的时间调用)

touch 1 STARTED 
touch 1 moved 
touch 1 moved 

touch 2 STARTED 
touch 2 moved 
touch 2 ENDED 

touch 1 moved 
touch 1 moved 
touch 1 ENDED 

但是,相反,他们都回来了以错误的顺序:

2011-12-02 14:55:37.187 coreplotround2[7396:707] touch 1 STARTED 
2011-12-02 14:55:41.182 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:41.582 coreplotround2[7396:707] touch 1 moved 

2011-12-02 14:55:41.743 coreplotround2[7396:707] touch 2 STARTED 
2011-12-02 14:55:41.902 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:41.904 coreplotround2[7396:707] touch 2 moved <---- at this point my 2nd finger is released!! 

2011-12-02 14:55:45.533 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:45.533 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:45.533 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:45.533 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:45.533 coreplotround2[7396:707] touch 1 moved 
2011-12-02 14:55:45.549 coreplotround2[7396:707] touch 1 ENDED 
2011-12-02 14:55:45.566 coreplotround2[7396:707] touch 2 ENDED 

的问题是,结束了触摸2在同一时间来触摸1结束,即使触摸2更早结束。

我使用的方法touchesBegan,touchesMoved,touchesEnded。

任何人都知道为什么吗?

+0

用给定的信息来说并不容易。你能发表你的触摸代码片段吗?此外,有时如果重叠触摸的iPhone会很困惑,并把它们合并成一个。 –

回答

0

我发现了原因。我从Core Plot图形库中分类了一个对象。这个对象是UIView的一个子类,所以我期望它接受触摸。因此,我重新声明了触摸听众并试图试验他们的表现。

我相信奇怪的事发生在这个特定的Core Plot对象中,这个对象与触摸顺序有关。我无法告诉你这是什么。

我通过创建一个空视图的新项目并测试多点触控发现了这一点。

我决定在它上面创建一个UIView来截取多槽,然后在Core Plot中调用相应的委托,而不是对核心图进行子类化。