Objective c “需要帮助理解”;KCGERORILLEGALargument:CGSUnionRegionWithRect:Invalid Region“;
在运行我的应用程序时(它做了大量的自定义绘图),我得到了这个错误(它发生得很好,没有明显的副作用,但我想了解发生了什么)Objective c “需要帮助理解”;KCGERORILLEGALargument:CGSUnionRegionWithRect:Invalid Region“;,objective-c,cocoa,core-animation,core-graphics,Objective C,Cocoa,Core Animation,Core Graphics,在运行我的应用程序时(它做了大量的自定义绘图),我得到了这个错误(它发生得很好,没有明显的副作用,但我想了解发生了什么) 我最近在控制台中收到了完全相同的消息。 就我而言,我用错误的方式更新了进度指标。 我的进度指示器显示在工作表上,我没有正确地取消该工作表。 错误总是在我第二次用beginSheet 您正在使用NSSheet吗? 对我来说,它起到了以下作用: 将didEndSelector传递给 beginSheet A[图纸关闭]在该范围内 选择器 最后是一个[NSApp endSheet]
我最近在控制台中收到了完全相同的消息。
就我而言,我用错误的方式更新了进度指标。
我的进度指示器显示在工作表上,我没有正确地取消该工作表。 错误总是在我第二次用
beginSheet
您正在使用NSSheet吗?
对我来说,它起到了以下作用:
didEndSelector
传递给
beginSheet
[NSApp endSheet]
来关闭该工作表事实证明,我是在请求NSProgressIndicator从非主线程显示。一旦我删除了这些信息,这些信息就会消失。如果您也将代码张贴在错误发生的地方,那将非常有帮助。我不知道错误发生在哪里。我的代码都不在堆栈跟踪中。这听起来很有希望。事实上,我正在更新一个进度指标,但我没有使用NSSheet(明确地说)。顺便说一句,你是如何调试你的问题的?是偶然发现的。起初我怀疑我的自定义绘图代码。但最终它是丢失的结尾。当我的工作表和进度指示器首次在应用程序运行中显示时,它工作正常。但它开始为随后的每次调用编写“无效区域”消息。
<Error>: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region
<Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch
errors as they are logged.
#0 0x94bee5f2 in CGErrorBreakpoint ()
#1 0x94c831d8 in CGSGlobalErrorv ()
#2 0x94a64b61 in CGSUnionRegionWithRect ()
#3 0x912a2a70 in -[NSRegion addRegion:] ()
#4 0x912a28c1 in -[NSWindow _setNeedsDisplayInRegion:] ()
#5 0x911f3548 in -[NSWindow _absorbDeferredNeedsDisplayRegion] ()
#6 0x911f2113 in -[NSView _sendViewWillDrawInRect:clipRootView:suppressRecursion:] ()
#7 0x91154ee9 in -[NSView displayIfNeeded] ()
#8 0x9111e292 in -[NSWindow displayIfNeeded] ()
#9 0x9114f764 in _handleWindowNeedsDisplay ()
#10 0x9408eb02 in __CFRunLoopDoObservers ()
#11 0x9404b65d in __CFRunLoopRun ()
#12 0x9404ad34 in CFRunLoopRunSpecific ()
#13 0x9404ab61 in CFRunLoopRunInMode ()
#14 0x97984fec in RunCurrentEventLoopInMode ()
#15 0x97984da3 in ReceiveNextEventCommon ()
#16 0x97984c28 in BlockUntilNextEventMatchingListInMode ()
#17 0x91125c95 in _DPSNextEvent ()
#18 0x9112550a in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#19 0x910e769b in -[NSApplication run] ()
#20 0x910df735 in NSApplicationMain ()
#21 0x00002a4f in main (argc=0x1, argv=0xbffff4d4) at
/Users/me/Code/myapp/src/main.m:19