【发布时间】:2011-07-10 22:14:21
【问题描述】:
我有一个工作正常的touchesBegan: 方法。但是我最近在我的 UIViewController 中添加了一个 UIView(一个按钮),现在该按钮没有注册点击,但是我的 touchesBegan: 方法是。
我怎样才能告诉我的touchesBegan: 方法避免使用该按钮?
这是我当前的touchesBegan: 方法:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"touches began");
UITouch *touch = [touches anyObject];
switch ([touch tapCount])
{
case 1:
break;
case 2:
if(something)
[doing something];
break;
default:
break;
}
}
【问题讨论】:
-
与往常一样,如果您在 IB 中创建按钮,请仔细检查以确保您已正确连接 IB 中的按钮。
标签: iphone ios uiview uiviewcontroller touchesbegan