先贴代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init];
//problem here.
UINavigationController *tmpNav = [[UINavigationController alloc] initWithRootViewController:tmpVC];
self.window.rootViewController = tmpNav;
[self.window makeKeyAndVisible];
return YES;
}
为什么无法在程序中把PHMessagingSplitViewController push 到NavigationController?
程序运行后系统提示:Split View Controllers cannot be pushed to a Navigation Controller <UINavigationController: 0x7bf993f0>.
另外,通过UIStoryboard却可以做到!
请问有谁可以解释一下这个问题?
我想通过程序实现,而不用噁心的Storyboard.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init];
//problem here.
UINavigationController *tmpNav = [[UINavigationController alloc] initWithRootViewController:tmpVC];
self.window.rootViewController = tmpNav;
[self.window makeKeyAndVisible];
return YES;
}
为什么无法在程序中把PHMessagingSplitViewController push 到NavigationController?
程序运行后系统提示:Split View Controllers cannot be pushed to a Navigation Controller <UINavigationController: 0x7bf993f0>.
另外,通过UIStoryboard却可以做到!
请问有谁可以解释一下这个问题?
我想通过程序实现,而不用噁心的Storyboard.