Xcode kCGErrorIllegalArgument:\u CGSFindSharedWindow?

Xcode kCGErrorIllegalArgument:\u CGSFindSharedWindow?,xcode,cocoa,Xcode,Cocoa,在尝试编写具有自定义背景的简单Cocoa/Applescript时(在本教程之后),我不时在调试器中遇到以下错误: Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 3162 Media Center[10234] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged

在尝试编写具有自定义背景的简单Cocoa/Applescript时(在本教程之后),我不时在调试器中遇到以下错误:

Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 3162
Media Center[10234] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
我不完全确定如何解决这个问题,如果需要,我会提供更多的输出信息


编辑:如果在显示停靠时打开应用程序,我会得到错误。如果没有显示dock,它通常会工作。

我也遇到过类似的问题。您是否尝试过选中窗口属性面板中的“关闭时释放”复选框?

我也遇到了同样的问题。我用代码从nib文件创建了一个窗口控制器,然后调用showWindow:方法并释放了窗口控制器。(释放和自动释放都会导致相同的问题。) 来自iOS世界,我想当我显示一个窗口时,这将增加控制器的保留计数,直到它关闭为止。事实证明,这不是它的工作方式,因此您必须保留对该控制器的引用,直到窗口打开

我希望这有帮助


raliz

我在一个相当简单的应用程序中遇到了同样的错误,我期待着看到你是否得到响应。同样,这个应用程序非常简单。如果你喜欢的话,可以向上投票:D有点失望,还没有人回答……不敢相信没有人回答。“这真的很罕见吗?”查利:不,不是真的,但是你可以考虑设置一个赏金使它出现在“特色”列表中或者编辑这个问题,这样它就重新出现在“活跃”列表中。
Thread 1, Queue : com.apple.main-thread
#1  0x00007fff92ba4112 in CGSGlobalErrorv ()
#2  0x00007fff92c7ca25 in _CGSFindSharedWindow ()
#3  0x00007fff92b275a9 in _CGSWindowByID ()
#4  0x00007fff92c2cdf9 in CGSOrderFrontConditionally ()
#5  0x00007fff93ce1ecf in __-[NSApplication _copyBatchWindowOrderingPerformerForToken:release:]_block_invoke_2 ()
#6  0x00007fff93d0f685 in -[NSPersistentUIManager resumeNormalWindowOrderingAndDrawing] ()
#7  0x00007fff93d0f52f in -[NSPersistentUIManager tearDownStateRestorationApparatusAndResumeWindowOrdering] ()
#8  0x00007fff93d0f374 in -[NSPersistentUIManager finishedRestoringWindowsWithZOrder:registerAsReady:completionHandler:] ()
#9  0x00007fff944f25ed in __-[NSPersistentUIManager restoreAllPersistentStateWithTalagentWindows:registeringAsReadyWhenDone:completionHandler:]_block_invoke_3 ()
#10 0x00007fff944f4080 in __-[NSPersistentUIManager restoreAllPersistentStateWithTalagentWindows:registeringAsReadyWhenDone:completionHandler:]_block_invoke_2 ()
#11 0x00007fff93f323e8 in __-[NSApplication(NSPersistentUISupport) _restoreWindowWithRestoration:handler:]_block_invoke_1 ()
#12 0x00007fff944f2760 in __-[NSApplication(NSPersistentUISupport) _restoreWindowWithRestoration:handler:]_block_invoke_3 ()
#13 0x00007fff94c2e44c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
#14 0x00007fff94be6562 in __CFRunLoopDoBlocks ()
#15 0x00007fff94c0e195 in __CFRunLoopRun ()
#16 0x00007fff94c0dae6 in CFRunLoopRunSpecific ()
#17 0x00007fff8cfdf3d3 in RunCurrentEventLoopInMode ()
#18 0x00007fff8cfe658f in ReceiveNextEventCommon ()
#19 0x00007fff8cfe64ca in BlockUntilNextEventMatchingListInMode ()
#20 0x00007fff93cdc3f1 in _DPSNextEvent ()
#21 0x00007fff93cdbcf5 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#22 0x00007fff93cd862d in -[NSApplication run] ()
Thread 2, Queue : (null)
Thread 3, Queue : com.apple.libdispatch-manager
Thread 4, Queue : (null)
Thread 6, Queue : (null)
Thread 7, Queue : (null)