iOS 4.0 快速应用程序切换
好吧,我正在尝试在我的应用程序上实现快速切换,如果我不需要执行任何后台代码/保存任何用户数据,我真的需要做任何事情吗?或者我只是升级到 iPhone SDK 4.0,单击编译并部署?
有什么方法可以模拟内存不足异常,使操作系统清除应用程序以测试它如何重新启动?
谢谢,
泰贾。
Okay, I'm trying to implement fast switching on my app, and if I don't have to execute any background code / save any user data, do I really even need to do anything ? Or do I just upgd to iPhone SDK 4.0, click compile, and deploy?
Is there any way to simulate an out of memory exception, make the OS purge the application to test how it's being relaunched?
Thanks,
Teja.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要的只是快速用户切换,我发现使用 iOS4 SDK 重新编译就足以使您的应用程序“快速切换就绪”。您只需要确保您的应用程序可以处理内存警告,并能够恢复因内存警告而必须释放的任何数据。
模拟内存警告的最简单方法是通过 iPhone 模拟器,在“硬件”->“硬件”下。模拟内存警告。就我个人而言,我使用 Mac OSX 键盘首选项为该菜单项设置热键,以便我可以在应用程序上快速模拟内存警告。
If all you want is fast-user switching, I found that recompiling with the iOS4 SDK is sufficient in order to make your app 'fast-switch ready.' You just need to make sure your app can deal with memory warnings and being able to restore any data you had to release as a result of a memory warning.
The easiest way to simulate a memory warning is through the iPhone simulator, under Hardware -> Simulate Memory Warning. Personally, I used the Mac OSX Keyboard preferences to set a hot-key for that menu item so I can quickly simulate memory warnings on my app.