使用 Parse 框架,我试图让用户登录到应用程序,如果在用户按下登录按钮时登录有效,我希望改变视图。在这种特定情况下,如果(!错误)我希望切换视图。假设第二个视图称为 PostingViewController,我怎么能做到这一点?
-(IBAction)signUpButton:(id)sender
{
NSString *userInput = usernameInputField.text;
NSString *userPassword = passwordInputField.text;
PFUser *user = [PFUser user];
user.username = userInput;
user.password = userPassword;
[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(!error){
}
else{
NSLog(@"there was a problem");
}
}];
}