Return 到以前的 WatchKit 接口控制器

Return to Previous WatchKit Interface Controller

我有一个界面控制器,当按下一个按钮时,它会转到另一个界面控制器。我这样做

- (IBAction)setLocationPressed {
    [self pushControllerWithName:@"setLocation" context:self.appContext];
}

如何在按下第二个控制器上的按钮时return到第一个控制器?

如果您查看 WKinterfaceController (https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceController_class/index.html#//apple_ref/occ/instm/WKInterfaceController/popController) 的文档,您会看到两种与您想要执行的操作相关的方法:popControllerpopToRootController.