Tag: touches

touchesBegan不在UIView子类中调用

我试图模仿GLPaint应用程序,我有一个TDPaintingView具有方法-(void)touchesBegan…以及touchesMoved , touchesEnded ,并touchesCanceled 。 但是,我没有看到他们中的任何一个火。 我有一个TDAppDelegate连接到IB中的Window和IB中的TDPaintingView 。 我的TDPaintingView的initWithCoder方法肯定会触发,所以我知道它正在被初始化。 此外,我可以从TDPaintingView的上下文中logging对象TDPaintingView ,这是肯定存在的。 当我在IB中改变视图的方式(比如使bg红色)在模拟器上反映出来。 但是,我的观点并没有得到触动,而且这让我疯狂! 我在-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event上设置了一个断点-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event ,它永远不会停止,无论我在屏幕上的哪个位置触摸。 我的TDPaintingView没有子视图,它明确定义了触摸操作的方法。 我哪里错了?