Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 退出时出现应用程序错误-目标-C_Objective C_Cocoa - Fatal编程技术网

Objective c 退出时出现应用程序错误-目标-C

Objective c 退出时出现应用程序错误-目标-C,objective-c,cocoa,Objective C,Cocoa,退出应用程序时,出现以下错误: Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1 Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpo

退出应用程序时,出现以下错误:

Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Warning>: _CGSReferenceWindowByID: Window id 0xffffffff not found (locally or shared)
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: kCGErrorIllegalArgument: CGSDeviceCreate: Invalid window
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: Failed to create window context device
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082] <Error>: CGWindowContextCreate: failed to create window context delegate.
2012-04-11 20:32:31.679 NetCalc[25082:707] _initWithWindowNumber: error creating graphics ctxt object for ctxt:0x136f3, window:0xffffffff
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082]:kggerrorillegalargument:\u CGSFindSharedWindow:WID-1
4月11日20:32:31 imac.subnet192.com NetCalc[25082]:kCGErrorFailure:设置断点@CGErrorBreakpoint(),以便在记录错误时捕获错误。
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082]:_CGSReferenceWindowByID:未找到窗口id 0xffffff(本地或共享)
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082]:kCGErrorIllegalArgument:CGSDeviceCreate:无效窗口
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082]:无法创建窗口上下文设备
Apr 11 20:32:31 imac.subnet192.com NetCalc[25082]:CGWindowContextCreate:未能创建窗口上下文委托。
2012-04-11 20:32:31.679 NetCalc[25082:707]\u initWithWindowNumber:为ctxt:0x136f3,窗口:0xffffffff创建图形ctxt对象时出错
问题似乎不在代码中,在启动后关闭应用程序(不碰任何东西)会生成此错误消息

更新:

  • 该错误仅在我退出使用应用程序右上角的“X”时产生。如果在dock中单击鼠标右键或使用工具栏退出,则不会生成错误
  • 我不需要关闭应用程序来显示错误。关闭窗口就足够了

  • 我已取消了所有出口和操作的链接,只保留默认配置。我仍然得到错误


原来问题出在窗口的行为上。选中窗口的“关闭时释放”复选框可以解决问题。

正如复选框“关闭时释放”所说,可以解决问题。如果没有,请取消选中“一次性”复选框。

您是否可以编辑您的问题以合并相关文本字段的代码?(或者至少解释一下你是如何设置的)我一个接一个地注释了我所有的方法和操作,这似乎不是问题所在。