使用Parse Framework,我试图让用户登录到应用程序,如果用户按下登录按钮时登录工作,我希望视图更改。在这种特殊情况下,如果(!error)我希望视图切换。假设第二个视图叫做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");
}
}];
}
答案 0 :(得分:0)
只需创建一个PostingViewController对象的对象并将其推送到当前的navigationController
与此相似的一些事情可能会有所帮助...
PostingViewController *vc = [[PostingViewController alloc] initWithNibName:@"your_nib_name" andBundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:vc withAnimation:YES];
[vc release];