我正在使用Xcode,直到今天还没有意识到任何问题。我的AppDelegate使用以下代码来确定用户应该定向到主窗口或登录屏幕的位置。
// 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];
然后使用以下代码登录。登录在日志中注册。
[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: - )
答案 0 :(得分:0)
我刚刚通过更新Parse Framework解决了这个问题,这个问题奇怪地解决了这个问题?对于未来在这种情况下的人们可能会有用