如何在 iPhone 4.0 中配置注销
如何在 iPhone 4.0 中配置注销,因为它不会调用 applicationWillTerminate< /code>
4.0 中的方法。
How to configure log out in iPhone 4.0 as it does not call applicationWillTerminate
method in 4.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想支持多任务处理,则应该在应用程序委托中以及
- ( void)applicationWillTerminate:(UIApplication *)application
以支持不支持多任务或 4.0 之前的 iOS 的设备。但您也可以强制 iOS 使用“旧”行为,即不支持多任务并始终调用
applicationWillTerminate:
。为此,您需要编辑 Info.plist 并添加带有布尔值 YES 的UIApplicationExitsOnSuspend
键。If you want to support multi-tasking you are supposed to implement the
- (void)applicationDidEnterBackground:(UIApplication *)application
method in your app delegate for saving state, as well as in- (void)applicationWillTerminate:(UIApplication *)application
to support devices that do not have multi-tasking support or pre 4.0 iOS.But you can also force iOS to use the "old" behavior, that is to not support multi-tasking and always call
applicationWillTerminate:
. To do that, you need to edit your Info.plist and add the keyUIApplicationExitsOnSuspend
with a boolean value YES.