I need to call the IBAction method from the another class.
I am having the -(IBAction) addButtonPressed:(id)sender for button pressed action but i need the same function to be called in another method in some other class.
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.
Why you create the method with IBAction. just create a button from code and set selector to your method. Then you can easily access the method from another class.
here I’m showing you code how to create a button with selector.
then you Simply declare the method as
and then you can access this method from another class