问题
I have an IBAction button in one UIViewController that I want to perform an action in another UIViewController. How do I do this?
回答1:
Declare a method in the second UIViewController and call from the IBAction in the first controller.
Something like this:
-(IBAction)myMethodFromFirstController{
SecondController *secondController = [[SecondController alloc] init];
[secondController method];
}
来源:https://stackoverflow.com/questions/12763470/passing-an-ibaction-to-another-viewcontroller