Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个 UIViewController 中有一个 IBAction 按钮,我想在另一个 UIViewController 中执行一个操作。我该怎么做呢?
在第二个 UIViewController 中声明一个方法并从第一个控制器中的 IBAction 调用。
像这样的东西:
-(IBAction)myMethodFromFirstController{ SecondController *secondController = [[SecondController alloc] init]; [secondController method];
}