gpt4 book ai didi

ios - 呈现 UIAlertController 时出现 CGContext 错误

转载 作者:行者123 更新时间:2023-11-28 08:55:25 29 4
gpt4 key购买 nike

问题:我显示了一个 UIAlertController 并在控制台中收到了一大堆与 CGContext 相关的错误消息。有 3 个错误,每个错误重复 15 - 20 次,所以看起来控制台爆炸了!这些错误消息仅在我的应用程序的某些位置触发警报时才会出现 - 而不是在其他位置。在所有情况下,尽管有错误警告,UIAlertController 仍然显示得很好。我没有做任何自定义绘图/动画。在我的代码中,我没有使用任何与 CGContext 相关的东西。

我正在使用 XCode 6.4 和 iOS 8。这发生在模拟器和设备 (iPad) 上

关于导致错误消息的原因以及为什么它只在我的应用程序的某些部分发生的任何想法?

我看了这些帖子,但运气不好:

invalid context 0x0 under iOS 7.0 and system degradation

CGContext invalid context 0x0

我也尝试设置 CGPostError 符号断点,但它只显示汇编语言 - 没有任何用处。

以下是每次呈现 UIAlertController 时重复出现的三个 CGContext 错误:

Error: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Error: clip: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.`

Error: CGContextDrawLinearGradient: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.`

用于呈现 UIAlertController 的代码。 self 是一个 UIViewController。这可以通过按下按钮或选择表格 View 单元格等来触发:

let alert = UIAlertController(title: "TEST", message: "test", preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Cancel, handler: nil))
self.presentViewController(alert, animated: true, completion: nil)

最佳答案

一旦我升级到最新的 XCode (7.2),这些错误似乎就停止了。

关于ios - 呈现 UIAlertController 时出现 CGContext 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33224488/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com