【问题标题】:applicationWillEnterForeground and storyboard checkapplicationWillEnterForeground 和情节提要检查
【发布时间】:2013-03-23 14:11:00
【问题描述】:

我有一个 ios 应用程序,我在其中使用了故事板。

我有一个问题:当用户从后台返回时,我会检查用户会话是否仍然有效。如果此会话已过期,我会将用户发送到登录控制器(我的故事板上的第二步) 我该怎么做?

【问题讨论】:

  • 你有没有尝试过?
  • 我没有尝试过任何事情,因为我不知道什么是最好的解决方案!

标签: ios uistoryboard usersession


【解决方案1】:

就这样吧

伪代码不是实际代码

(void)applicationWillEnterForeground
{
if(sessionAvailable)
{
//do normal next working
}
else
{
LoginViewController *loginViewController=[self.storyBoard instantiateViewControllerWithidentifier:@"LoginViewController"];
[self.navigationController pushViewController:loginViewController animates:YES];
}
}

【讨论】:

    猜你喜欢
    • 2014-02-22
    • 1970-01-01
    • 2010-11-30
    • 2012-04-27
    • 2019-03-01
    • 2013-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多