关于iphone的目标C的问题

时间:2010-10-11 10:51:03

标签: objective-c

-(void)touchesBegan :(NSSet *)touches withEvent:(UIEvent *)event
{
 [textValue resignFirstResponder];
 [super touchesBegan:touches withEvent:event];
}
有人可以解释一下这种方法的含义吗?

2 个答案:

答案 0 :(得分:2)

[textValue resignFirstResponder];

如果textValue控件目前具有焦点,通常用于隐藏键盘。

[super touchesBegan:touches withEvent:event];

调用父类的相同方法来保留标准触摸处理。

答案 1 :(得分:0)

来自documentation;

  

告诉接收者一个或多个   手指在视图中触地或   窗口。

     

主要事件处理方法   触摸是touchesBegan:withEvent:,   touchesMoved:withEvent:,   touchesEnded:withEvent:,和   touchesCancelled:withEvent :.该   这些方法的参数相关联   尤其是他们的活动   接触新的或有的   改变,从而允许响应者   跟踪和处理的对象   触及作为交付的事件   通过阶段的进展   多点触控序列。