- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我的应用程序使用典型的身份验证方案,其中用户使用他的凭据登录服务器,服务器返回一个身份验证 token ,然后将其存储在本地客户端 (iPhone) 上。
现在存储的身份验证 token 不太可能但有可能随着时间的推移而失效。由于使用该无效 token 发出的每个请求都会失败,因此我想在第一次发生该故障时通过“将用户注销”应用程序来处理这个问题。注意:该请求可能在后台线程中发出,因为该应用会定期与服务器同步。
注销意味着:
因此,用户可能正在查看应用内的某些内容,而 token 变得无效并开始注销过程。
由于所有内容都被删除(#2),向她提供登录 Controller 是不够的,因为在登录并关闭该 Controller 之后,之前的内容实际上已经不存在了。
为了防止这些副作用,我想完全删除层次结构中的所有 View Controller ,无论触发注销时它有多深。
所以我的问题是:
在呈现登录 Controller 之前“杀死”所有事件 Controller 的最佳方法是什么?
最佳答案
将您的 LoginViewController 分配给窗口的 rootViewController
。这是文档中对 rootViewController 的描述。这听起来和您想要完成的完全一样。
The root view controller provides the content view of the window. Assigning a view controller to this property (either programmatically or using Interface Builder) installs the view controller’s view as the content view of the window. If the window has an existing view hierarchy, the old views are removed before the new ones are installed.
关于iphone - iOS - 如何删除应用程序窗口层次结构中的所有 ViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19164278/
我正在尝试将多个水平链接的 Button 和 TextView 垂直链接为 View 集,但仍保持平面 View 层次结构。这是我的初始布局和代码:
到目前为止,我已经在Google BigQuery上训练了几种模型,目前我需要查看模型的外观(即架构,损失函数等)。 有没有办法获取这些信息? 最佳答案 仔细阅读文档后,我可以说该功能尚不存在。我什至
本文实例讲述了PHP实现二叉树深度优先遍历(前序、中序、后序)和广度优先遍历(层次)。分享给大家供大家参考,具体如下: 前言: 深度优先遍历:对每一个可能的分支路径深入到不能再深入为止,而且每个
我是一名优秀的程序员,十分优秀!