首次启动时viewDidLoad中的presentModalViewController [英] presentModalViewController in viewDidLoad on first launch
本文介绍了首次启动时viewDidLoad中的presentModalViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找,但遗憾的是没有运气。
I've been searching around but unfortunately have had no luck.
我的应用要求用户在他或她启动时首次登录/注册应用程序。我知道如何确定首次启动(使用NSUserDefaults),但每当我尝试呈现包含登录/注册控件的模态时,都没有任何反应。
My app requires the user to sign in/sign up the first time he or she launches the app. I know how to determine first launch (using NSUserDefaults) but whenever I try to present the modal containing the sign in/ sign up controls, nothing happens.
这是我的拥有:
-(void)viewDidLoad {
[self showLogin];
[super viewDidLoad];
}
-(void)showLogin {
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"AccountView" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:controller animated:YES];
[controller release];
}
然而,没有任何反应。主视图正常加载。非常感谢任何帮助。
However, nothing happens. The main view just loads as normal. Any help is greatly appreciated.
-Giles
推荐答案
[更新]
[UPDATE]
只需使用..
-(void)viewDidAppear:(BOOL)animated
{
}
而不是
-(void)viewDidLoad
{
}
非常感谢!
/ idiocy
这篇关于首次启动时viewDidLoad中的presentModalViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文