更新时间:2022-11-11 21:16:50
我发现如果我使用:
MapViewController *mapView = [self.storyboard instantiateViewControllerWithIdentifier:@"MapView"];
(MapView是我在故事板中为该场景/视图设置的标识符)
("MapView" is the identifier i set for that scene/view in storyboard)
我只是测试了旧的方式,它适用于我:
and i just tested the old way and it works for me:
mapViewController *mapView = [[mapViewController alloc] initWithNibName:@"mapViewController" bundle:[NSBundle mainBundle]];
我可以直接调用MapViewController中的方法,又名
i can call methods in MapViewController directly, aka
[mapView testMethod];