在 iPad 模拟器中测试我的通用应用程序时,当应用程序旋转时,我得到了一些奇怪的 Core Graphics 错误。该应用程序不会崩溃,但以下内容会输出到控制台:
<Error>: CGImageCreate: invalid image size: 0 x 0.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextSetStrokeColorWithColor: invalid context 0x0
<Error>: CGContextGetCompositeOperation: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGImageCreate: invalid image size: 0 x 0.
<Error>: CGContextSetFillColorWithColor: invalid context 0x0
<Error>: CGContextSetStrokeColorWithColor: invalid context 0x0
<Error>: CGContextGetCompositeOperation: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
<Error>: CGContextSaveGState: invalid context 0x0
<Error>: CGContextSetCompositeOperation: invalid context 0x0
<Error>: CGContextFillRects: invalid context 0x0
<Error>: CGContextRestoreGState: invalid context 0x0
在我的应用程序中,我有一个UITabBarController
作为我的根视图控制器,它在其选项卡中包含一个导航控制器和两个拆分视图控制器。我将旋转事件等转发到拆分视图控制器。
我认为问题出在拆分视图控制器的某个地方,因为其中一个控制器有一个包含图像视图(还有几个标签和一个文本视图)的详细视图,其中一个错误是CGImageCreate
,但我可能会走得很远。另一个拆分视图控制器的详细视图控制器只是一个 Web 视图。两个详细视图都放在 IB 中。
有人有想法么?
谢谢。