0
我試圖以編程方式呈現嵌入到它的UITableViewController
和UINavigationController
。但是,它在沒有導航控制器的情況下顯示。我該如何解決這個問題?導航到嵌入UINavigationController的UITableViewController
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MyTableViewController *myt = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:@"mytableviewControllerID"];
UINavigationController *nav = ((UINavigationController*)myt);
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
}