iphone - 尽管应用程序在前台,但 UIApplicationState 返回 Inactive

标签 iphone ios cocoa-touch ipad

在启动后不久,我的应用程序会旋转一个单独的线程。此线程检查应用程序是在后台还是处于事件状态,因为它可以从其中任何一个调用。但是,当应用程序显式启动时,[UIApplication sharedApplication].applicationState 返回 UIApplicationStateInactive。我希望它返回 UIApplicationStateActive。这是怎么回事?谢谢!

最佳答案

苹果文档中是这么说的:

You should use this method to initialize your application and prepare it for running. It is called after your application has been launched and its main nib file has been loaded. At the time this method is called, your application is in the inactive state. At some point after this method returns, a subsequent delegate method is called to move your application to the active (foreground) state or the background state.

关于iphone - 尽管应用程序在前台,但 UIApplicationState 返回 Inactive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8212183/

相关文章:

iphone - MPMoviePlayerController 在连续视频之间产生闪烁

iphone - 以编程方式检测 iPhone 中 Sim 卡是否可用

ios - 如何检测 UIView 大小何时在 swift ios xcode 中更改?

ios - 通过电子邮件注册用户接受重复的电子邮件(firebase-swift)

iphone - Xcode 4.1 中缺少 iOS 5.0?

ios - 如何判断某个文本是否完整显示在 UITableViewCell 中?

objective-c - 允许根据 url 字符串选择表格 View 单元格

iphone - 是否可以在没有 APNS 的情况下进行推送通知

ios - 如何使用 NSPredicate

ios - MPMoviePlayer 在查找文件时播放音频但不播放视频