NavController窃取初始视图

时间:2014-11-01 18:23:28

标签: ios uinavigationcontroller uistoryboard xcode-storyboard

我有一个名为CRViewController的主菜单,在主菜单中,用户有5个菜单选项。其中一个是聊天。但是,当我启动应用程序时,我将被推送到Chat MenuView。我知道它来自我的AppDelegate,但我不确定如何解决这个问题。

@implementation CRAppDelegate

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    BOOL wasHandled = [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
    // add any app-specific handling code here
    return wasHandled;
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:[[MenuView alloc] init]];
    navController.navigationBar.translucent = NO;
    navController.navigationBar.barTintColor = COLOR_TITLE;
    navController.navigationBar.tintColor = COLOR_TITLETEXT;
    navController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:COLOR_TITLETEXT};

    [self.window setRootViewController:navController];
    [self.window makeKeyAndVisible];

    return YES;

    // Override point for customization after application launch.
    return YES;
}

0 个答案:

没有答案