Ios 如何在使用FBLoginView进行快速应用程序切换之前检查布尔值

Ios 如何在使用FBLoginView进行快速应用程序切换之前检查布尔值,ios,facebook-graph-api,facebook-ios-sdk,Ios,Facebook Graph Api,Facebook Ios Sdk,这是一个简单的场景,我使用的是FBLoginView,它显示一个登录按钮,点击应用程序go进行快速切换,但我想在应用程序go进行快速切换之前检查条款和条件的布尔值。我无法找到实现这种情况的方法 - (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView { // Upon login, transition to the main UI by pushing it onto the navigation stack.

这是一个简单的场景,我使用的是FBLoginView,它显示一个登录按钮,点击应用程序go进行快速切换,但我想在应用程序go进行快速切换之前检查条款和条件的布尔值。我无法找到实现这种情况的方法

    - (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView {
    // Upon login, transition to the main UI by pushing it onto the navigation stack.

        LGAppDelegate *appDelegate = (LGAppDelegate *)[UIApplication sharedApplication].delegate;
        [self.navigationController pushViewController:((UIViewController *)appDelegate.mainViewController) animated:YES];
}

- (void)acceptTermsAndConditions {

    if (!_checkboxButton.checked) {
        NSString *alertMessage, *alertTitle;
        alertTitle  = @"Terms to Use";
        alertMessage = @"Please accept the terms & condition to use this application.";
        UIAlertView* av = [[UIAlertView alloc] initWithTitle:alertTitle
                                                     message:alertMessage
                                                    delegate:nil
                                           cancelButtonTitle:@"OK"
                                           otherButtonTitles:nil];
        [av show];
        [av release];
    }
}

- (void)loginView:(FBLoginView *)loginView
      handleError:(NSError *)error{
    NSString *alertMessage, *alertTitle;

    // Facebook SDK * error handling *
    // Error handling is an important part of providing a good user experience.
    // Since this sample uses the FBLoginView, this delegate will respond to
    // login failures, or other failures that have closed the session (such
    // as a token becoming invalid). Please see the [- postOpenGraphAction:]
    // and [- requestPermissionAndPost] on `SCViewController` for further
    // error handling on other operations.

    if (error.fberrorShouldNotifyUser) {
        // If the SDK has a message for the user, surface it. This conveniently
        // handles cases like password change or iOS6 app slider state.
        alertTitle = @"Something Went Wrong";
        alertMessage = error.fberrorUserMessage;
    } else if (error.fberrorCategory == FBErrorCategoryAuthenticationReopenSession) {
        // It is important to handle session closures as mentioned. You can inspect
        // the error for more context but this sample generically notifies the user.
        alertTitle = @"Session Error";
        alertMessage = @"Your current session is no longer valid. Please log in again.";
    } else if (error.fberrorCategory == FBErrorCategoryUserCancelled) {
        // The user has cancelled a login. You can inspect the error
        // for more context. For this sample, we will simply ignore it.
        NSLog(@"user cancelled login");
    } else {
        // For simplicity, this sample treats other errors blindly, but you should
        // refer to https://developers.facebook.com/docs/technical-guides/iossdk/errors/ for more information.
        alertTitle  = @"Unknown Error";
        alertMessage = @"Error. Please try again later.";
        NSLog(@"Unexpected error:%@", error);
    }

    if (alertMessage) {
        [[[UIAlertView alloc] initWithTitle:alertTitle
                                    message:alertMessage
                                   delegate:nil
                          cancelButtonTitle:@"OK"
                          otherButtonTitles:nil] show];
    }
}

- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
    // Facebook SDK * login flow *
    // It is important to always handle session closure because it can happen
    // externally; for example, if the current session's access token becomes
    // invalid. For this sample, we simply pop back to the landing page.
    LGAppDelegate *appDelegate = (LGAppDelegate *)[UIApplication sharedApplication].delegate;
    if (appDelegate.isNavigating) {
        // The delay is for the edge case where a session is immediately closed after
        // logging in and our navigation controller is still animating a push.
        [self performSelector:@selector(logOut) withObject:nil afterDelay:.5];
    } else {
        [self logOut];
    }
}

- (void)logOut {
    [self.navigationController popToRootViewControllerAnimated:YES];
}

检查like if(bool_对象)…我不能这样检查,因为没有方法可以覆盖FBLoginView:(