tags:

views:

33

answers:

2
-(void)touchesBegan :(NSSet *)touches withEvent:(UIEvent *)event
{
 [textValue resignFirstResponder];
 [super touchesBegan:touches withEvent:event];
}

can someone explain me the meaning of this method???

+2  A: 
[textValue resignFirstResponder];

Usually used to hide the keyboard if textValue control has focus at the moment.

[super touchesBegan:touches withEvent:event];

Calls the same method of parent class to preserve standard touch handling.

Vladimir
thanks a lot Vladimir!!
vidhya jain
A: 

From the documentation;

Tells the receiver when one or more fingers touch down in a view or window.

The primary event-handling methods for touches are touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and touchesCancelled:withEvent:. The parameters of these methods associate touches with their events, especially touches that are new or have changed and thus allow responder objects to track and handle the touches as the delivered events progress through the phases of a multi-touch sequence.

Jeroen de Leeuw