开发者

Navigate UIView to UINavigationViewController

开发者 https://www.devze.com 2023-04-03 22:06 出处:网络
I have a UIView and I need to switch to UINavigationController.This is the code I am using to navigate:

I have a UIView and I need to switch to UINavigationController. This is the code I am using to navigate:

MainMenuNavigationViewController * aMainMenuNavigationViewController = [[MainMenuNavigationViewController alloc] initWithNibName:@"MainMenuNavigationViewController" bundle:nil开发者_开发技巧];
[self presentModalViewController:aMainMenuNavigationViewController animated:YES];

I am getting an error

-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MainMenuNavigationViewController" nib but the view outlet was not set.'

I wasted around 12 hours searching the internet. However I could not find the solution.


In your MainMenuNavigationViewController.xib open in Interface builder, In document window right click on view referencing outlet was not set, so right click and select files owner view. That was the issue there. Now code that you shared isn't loading viewController using navigation Controller you are presenting MainMenuNavigationViewController modally presentModalViewController.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号