2

我正在尝试从我的 UIViewController 中删除状态栏。我进入 info.plist 并将其更改View controller-based status bar appearanceNO并在我的 AppDelegate.swift 中实现了以下内容:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    application.statusBarHidden = true
    return true
}

当我运行我的应用程序时,怎么会在控制台中出现以下错误。我正在运行 Xcode 7.0 beta 6 (7A192o):

<Error>: CGContextSaveGState: 无效的上下文 0x0。如果要查看回溯,请设置 CG_CONTEXT_SHOW_BACKTRACE 环境变量。

<Error>: CGContextTranslateCTM: 无效的上下文 0x0。如果要查看回溯,请设置 CG_CONTEXT_SHOW_BACKTRACE 环境变量。

<Error>:CGContextRestoreGState:无效的上下文0x0。如果要查看回溯,请设置 CG_CONTEXT_SHOW_BACKTRACE 环境变量。

请务必注意,状态栏已从视图中移除。每当我运行应用程序时,我都会收到此错误。

4

1 回答 1

0

这是 iOS 9 的一个已知问题。您可以放心地忽略此错误。

https://forums.developer.apple.com/thread/13683

于 2015-09-13T21:33:29.133 回答