vidhya jain
vidhya jain

Reputation: 99

Question of Objective C on iphone

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

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

Upvotes: 1

Views: 56

Answers (2)

Jeroen de Leeuw
Jeroen de Leeuw

Reputation: 907

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.

Upvotes: 0

Vladimir
Vladimir

Reputation: 170809

[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.

Upvotes: 2

Related Questions