I want to disable input pad on iphone when pressing ‘done’. Any ideas about how to detect button press event?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Programatic Method
To register button press events you can either do the programmatic approach:
Where buttonPressed: is a method in the class ‘self’:
You can specify a pointer to any object instead of ‘self’ of course, as long as the object has a buttonPressed: method.
Interface Builder
You can also use Interface Builder. Create a method that you want to execute:
Then right click on the button in interface builder. You should see a list of actions. On the ‘touch up’ action click on the circle button, and drag a connector to the object representing the class where you put the buttonPressed: method.
Disabling Input Pad
I’m not sure what you mean by this. Are you talking about dismissing a keyboard input? If so, you have to call the ‘resignFirstResponder:’ method. Say, for example, the keyboard pops up because you are editing a text field. To dismiss the keyboard call the following method on the text field: