序列化 iPhone 导航控制堆栈
我们可以序列化 iPhone 导航控制器的堆栈来保存状态吗?苹果允许吗?
Can we Serialize the iPhone Navigation controller's stack to save the state? Is it allowed by Apple?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
保存堆栈就像读取推送到导航控制器的控制器列表并序列化它们一样简单:
我不记得 Apple 要求开发人员不要做这样的事情的明确指导方针。
Saving the stack is as easy as reading the list of controllers pushed to the navigation controller and serializing them:
I can't remember explicit guidelines from Apple that require developers not to do such a thing.
您能给我们更多提示吗?为什么要这样做?这是为了在导航控制器中保存用户选择吗?如果我是你,我会通过这样做来保存类名
并将其保存在 NSUserDefault 之类的地方,稍后如果你想再次将其推送到堆栈,那么你需要
希望帮助
:)
can you give us more hint, why you want to do that? Is this for saving the user selection in the navigation controller? If I were you, I would save the class name by doing
and save it somewhere like NSUserDefault, later if you want to push it again to stack then you need
hope helps
:)