解析 [PFUser currentUser] 不工作

Parse [PFUser currentUser] Not Working

我正在使用 Xcode,直到今天还没有发现任何问题。我的 AppDelegate 使用以下代码来确定应将用户定向到主屏幕 window 或登录屏幕的位置。

// determine the initial view controller here and instantiate it
    self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    PFUser *currentUser = [PFUser currentUser];

    UIViewController *viewController = [[UIViewController alloc] init];
    if (!currentUser) {
        // Show Login / Sign Up Window
        viewController = [storyboard instantiateViewControllerWithIdentifier:@"signUpOrRegister"];
    } else {
        // User Logged In Already
        viewController = [storyboard instantiateViewControllerWithIdentifier:@"rootVC"];
    }

    self.window.rootViewController = viewController;
    [self.window makeKeyAndVisible];

然后用下面的代码登录。登录在Log中注册。

[PFUser logInWithUsernameInBackground:[_loginUsernameField.text lowercaseString]
                                 password:_loginPasswordField.text
                                    block:^(PFUser *user, NSError *error) {
                                        if (user) {
                                            // Do stuff after successful login.
                                            [self displayMessageToUser:@"Welcome Back"];
                                            NSLog(@"Successful: Login: %@", user.objectId);
                                            [self segueToWindowOfChoice];
                                        } else {
                                            // The login failed. Check error to see why.
...

有什么想法吗?

谢谢

D:-)

我只是通过更新奇怪地解决了问题的解析框架就解决了这个问题?可能对以后遇到这种情况的人有用