作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在运行我的应用程序(执行大量自定义绘图)时,我收到此错误(它经常发生,没有明显的副作用,但我想了解发生了什么)。
<Error>: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region
<Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch
errors as they are logged.
所以我设置了那个断点并获得了这个堆栈。堆栈帧都不是我的代码,尽管在某些情况下我肯定已经覆盖了 NSView 的 drawRect。
有没有人以前见过这个或者对正在发生的事情有洞察力?
#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
最佳答案
我最近在控制台中收到了完全相同的消息。
就我而言,我以错误的方式更新了进度指示器。
我的进度指示器显示在一张纸上,但我没有正确关闭这张纸。第二次我用 beginSheet
显示 NSSheet 时总是弹出错误您在使用 NSSheet 吗?
对我来说,它可以:
didEndSelector
给beginSheet
.[sheet close];
在其中选择器[NSApp endSheet]
来关闭工作表关于objective-c - 需要帮助理解 "kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid Region",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1596493/
在尝试编写具有自定义背景的简单 Cocoa/Applescript 时(按照本教程 http://www.mere-mortal-software.com/blog/details.php?d=200
在运行我的应用程序(执行大量自定义绘图)时,我收到此错误(它经常发生,没有明显的副作用,但我想了解发生了什么)。 : kCGErrorIllegalArgument: CGSUnionRegionWi
我是一名优秀的程序员,十分优秀!