gpt4 book ai didi

objective-c - 需要帮助理解 "kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid Region"

转载 作者:太空狗 更新时间:2023-10-30 03:51:03 24 4
gpt4 key购买 nike

在运行我的应用程序(执行大量自定义绘图)时,我收到此错误(它经常发生,没有明显的副作用,但我想了解发生了什么)。

<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 吗?
对我来说,它可以:

  1. 传递一个didEndSelectorbeginSheet.
  2. A [sheet close]; 在其中选择器
  3. 最后是一个 [NSApp endSheet] 来关闭工作表

关于objective-c - 需要帮助理解 "kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid Region",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1596493/

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