简体   繁体   English

成功登录StackMob后如何“推送”到新的视图控制器

[英]How to “push” to new view controller after successful login StackMob

I'm using stack mob as back-end provider and I'm trying to get my login screen to work. 我正在使用Stack Mob作为后端提供程序,并且试图使我的登录屏幕正常工作。

After a successful login I want to move to a new UIViewController . 成功登录后,我想移至新的UIViewController It seems simple enough but I'm having issues. 看起来很简单,但是我遇到了问题。

I thought I could do this: 我以为我可以这样做:

MyViewController* viewController = [[MyViewController alloc] init];

[self.navigationController pushViewController:viewController animated:YES];

Inside of the onSuccess : onSuccess内部:

- (IBAction)login:(id)sender {

[self.client loginWithUsername:self.usernameField.text 
             password:self.passwordField.text 
             onSuccess:^(NSDictionary *results) {

NSLog(@"Login Success %@",results);

Is there a better way to do this? 有一个更好的方法吗? Please help! 请帮忙!

What you posted is correct and it's the best way to do it. 您发布的内容是正确的,这是最好的方法。

If for some reason the view controller is not pushed correctly, it's probably because you are not pushing the new view controller on the right navigation controller stack. 如果由于某种原因未正确推送视图控制器,则可能是因为您没有将新的视图控制器推送到正确的导航控制器堆栈上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM