gpt4 book ai didi

ios - CGContext清除警告

转载 作者:可可西里 更新时间:2023-11-01 03:35:10 26 4
gpt4 key购买 nike

我在使用 CGImageDestinationFinalize 时遇到 iOS 问题。我将在 CGImageDestinationRef 上调用 CGImageDestinationFinalize,我将收到以下警告

Error: The function `CGContextClear' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.

查看 Instruments,当我调用 CGImageDestinationFinalize 时,我的内存使用量猛增(有时会高到崩溃)。我不确定是否应归咎于此问题,但我已将其隔离为 CGImageDestinationFinalize 的问题

关于使用什么来避免调用 CGContextClear 有什么建议吗?或者如何使用 CGImageDestinationFinalize 减少内存使用量?

最佳答案

我会明确地说它与 CGContextClear 有关。它会保留您正在绘制的任何内容。虽然您的上下文没有被清除或释放,但它会将在该上下文中定义的元素保留在内存中。您使用的是哪个版本的 iOS?
我很确定 CGContextClear 不适用于 iOS 6 及更高版本。

如果您查看文档,您会注意到 CGContextClear 不再出现 https://developer.apple.com/library/ios/DOCUMENTATION/GraphicsImaging/Reference/CGContext/Reference/reference.html

寻找可能对您的目的有帮助的 CGContextClearRect

关于ios - CGContext清除警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13740550/

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