应用程序在后台模式下不断关闭

发布于 2024-11-28 13:15:51 字数 192 浏览 1 评论 0原文

我的 iPhone 应用程序出现严重问题。进入后台模式(来电甚至按下主页按钮)后它会关闭...我已在 info.plist 上插入 UIApplicationExitOnSuspend 并将其值设置为 false。但同样的问题存在......

你对这个问题有什么建议吗?我真的需要在进入后台模式时暂停应用程序而不是关闭应用程序...

谢谢

I have a serious problem in my iphone application. It gets closed after entering in background mode (incoming call or even home button press)...I have inserted UIApplicationExitOnSuspend on info.plist and made its value false. But same problem exists...

Do you have any suggestions for this issue? I really need the application to be suspended not closed when entering to background mode...

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深海少女心 2024-12-05 13:15:51

在您的 Info.plist 文件中看到您选择了应用程序不在后台运行,请注意不得选择此选项,如果选择此选项则意味着删除该选项从您的 Info.plist 文件中选择,我认为这肯定会起作用,我希望这会帮助您

并实现这些回调函数

-(void)applicationDidEnterBackground:(UIApplication *)application;

-(void)applicationWillEnterForeground:(UIApplication *)application;
in your App delegate 

See in your Info.plist file that you had selected the Application does not run in background, see this option must not be selected, if this option is selected means then remove that option from your Info.plist file, this will surely work I think and I hope this will help you

And Implement these Callback function

-(void)applicationDidEnterBackground:(UIApplication *)application;

-(void)applicationWillEnterForeground:(UIApplication *)application;
in your App delegate 
揪着可爱 2024-12-05 13:15:51

如果此应用程序是由 Xcode 3.x 的旧模板制作的,那么它可能没有系统使用的方法来检查您的应用程序是否处理与后台的转换。

确保您的应用程序委托实现了哪些方法:

-(void)applicationWillResignActive:(UIApplication *)application;
-(void)applicationDidEnterBackground:(UIApplication *)application;
-(void)applicationWillEnterForeground:(UIApplication *)application;
-(void)applicationDidBecomeActive:(UIApplication *)application;

If this application was made from old templates of Xcode 3.x, than it probably don't have methods which used by system to check whether your app handle transitions to/from background or not.

Make sure what this methods implemented by your application delegate:

-(void)applicationWillResignActive:(UIApplication *)application;
-(void)applicationDidEnterBackground:(UIApplication *)application;
-(void)applicationWillEnterForeground:(UIApplication *)application;
-(void)applicationDidBecomeActive:(UIApplication *)application;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文