2

我已经在我的 iOS 应用程序中设置了 Facebook SDK。我试图弄清楚如何在登录后让我的应用程序打开到情节提要视图。这是我的AppDelegate.m中控制它的部分。现在,该应用程序设置为在成功登录后打开一个 ViewController xib 文件。如何更改此代码,以便应用程序在成功登录后打开故事板视图?

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.



    self.mainViewController = [[SSViewController alloc]
                               initWithNibName:@"SSViewController" bundle:nil];
    self.navController = [[UINavigationController alloc]
                          initWithRootViewController:self.mainViewController];
    self.window.rootViewController = self.navController;
    [self.window makeKeyAndVisible];



    if (FBSession.activeSession.state == FBSessionStateCreatedTokenLoaded) {

        // Yes, so just open the session (this won't display any UX).
        [[FBSession activeSession] closeAndClearTokenInformation];

    } else {
        // No, display the login page.
        [self showLoginView];

    }

        return YES;

}
4

0 回答 0