Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ios-登录和注册按钮不起作用(树屋和解析)_Ios_Login_Parse Platform_Segue - Fatal编程技术网

ios-登录和注册按钮不起作用(树屋和解析)

ios-登录和注册按钮不起作用(树屋和解析),ios,login,parse-platform,segue,Ios,Login,Parse Platform,Segue,我的登录和注册按钮正常工作,但由于某种原因,在我填写了unsername和password字段并按下login按钮后,botton将不会推到我的收件箱控制器。但如果我停止我的项目,然后重新运行它,它将加载为登录。我不知道为什么!任何帮助都将不胜感激- - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.navigationItem.hidesBackB

我的登录和注册按钮正常工作,但由于某种原因,在我填写了unsername和password字段并按下login按钮后,botton将不会推到我的收件箱控制器。但如果我停止我的项目,然后重新运行它,它将加载为登录。我不知道为什么!任何帮助都将不胜感激-

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationItem.hidesBackButton = YES;
}


- (IBAction)login:(id)sender {


NSString *username = [self.usernameField.text
                      stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

NSString *password = [self.passwordField.text
                      stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

if ([username length] == 0 || [password length] == 0) {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops!"
                                                        message:@"Make sure you enter a username and password!"
                                                       delegate:Nil cancelButtonTitle:@"Okey"
                                              otherButtonTitles:nil];
    [alertView show];
} else {
    [PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {
        if (error) {
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry!"
                                                                message:[error.userInfo objectForKey:@"error"]
                                                               delegate:Nil cancelButtonTitle:@"Ok"
                                                      otherButtonTitles:nil];
            [alertView show];
        } else {
            [self.navigationController popToRootViewControllerAnimated:YES];
        }
    }];
}
}

@end

我建议在上使用该方法,因为他们的委托非常可靠和简单。但是,您可能需要重新构造视图序列。是否可以捕获从服务器返回的任何日志/错误消息?hey@dwightgunning我获得此日志:开始/结束外观转换的不平衡调用,如果登录中的唯一代码为[self.navigationController popToRootViewControllerAnimated:YES];?