简体   繁体   English

视图加载后的调用方法

[英]Calling method after view has loaded

My iPhone app allows for users to type in their usernames and passwords so that they can login. 我的iPhone应用程序允许用户输入用户名和密码,以便他们登录。 When they login once, their usernames and passwords are saved so that users don't have to type it in again. 当他们登录一次时,将保存其用户名和密码,以便用户不必再次输入。 My problem is, when the app starts again, it immediately starts logging them in, leaving the interface completely black. 我的问题是,当应用再次启动时,它立即开始登录它们,使界面完全变黑。 How would I go about calling my login method AFTER all the UI methods are loaded? 加载所有UI方法后如何调用我的登录方法?

Implement your login code in the viewDidLoad method of your view controller. 在视图控制器的viewDidLoad方法中实现您的登录代码。 Alternatively, do your login in a background thread so that it doesn't freeze the UI which is occuring on the main thread. 或者,在后台线程中进行登录,以免冻结主线程中出现的UI。

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

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