Ios 找不到导航控制器以导航其他视图控制器

Ios 找不到导航控制器以导航其他视图控制器,ios,objective-c,uiviewcontroller,uinavigationcontroller,uipageviewcontroller,Ios,Objective C,Uiviewcontroller,Uinavigationcontroller,Uipageviewcontroller,我有一个自定义的UIPageViewController,其中包含5个UIViewController,现在我想从这5个UIViewController中的一个导航,但我不能,因为在那些UIViewController中没有UINavigationController。有谁能建议我,如何从这5个UIViewControllers导航到另一个UIViewControllers?您的-[AppDelegate应用程序:didFinishLaunchingWithOptions: 可能如下所示(当然,

我有一个自定义的
UIPageViewController
,其中包含5个
UIViewController
,现在我想从这5个
UIViewController
中的一个导航,但我不能,因为在那些
UIViewController
中没有
UINavigationController
。有谁能建议我,如何从这5个
UIViewControllers
导航到另一个
UIViewControllers

您的-
[AppDelegate应用程序:didFinishLaunchingWithOptions:
可能如下所示(当然,在检查您的跳过条件之后):


如果仅将其粘贴到-
[AppDelegate应用程序:didFinishLaunchingWithOptions:
,您将看到它立即工作。

您可以通过以下方式从一个控制器导航到另一个控制器:-[self-presentModalViewController:temp-animated:YES];我认为你需要遵循“”教程。您需要通过
Embed->navigation Controller
创建导航栏,并将其设置为初始视图控制器。或者按照教程手动创建导航栏使用pageviewcontroller导航,您可以按下viewcontroller
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *vc1 = [storyboard instantiateViewControllerWithIdentifier:@"MyAuth"]; //if you assigned this ID is storyboard
UIViewController *vc2 = [storyboard instantiateViewControllerWithIdentifier:@"Login"];  //if you assigned this ID is storyboard
UIViewController *vc3 = [storyboard instantiateViewControllerWithIdentifier:@"Details"];
NSArray *controllers = @[vc1, vc2, vc3];
UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
[navController setViewControllers:controllers];