warnings - "Does not make sense to draw an image"- 升级到 Mountain Lion 后出现警告

标签 warnings osx-mountain-lion

在我将我的编程机器升级到 MountainLion 并将 XCode 升级到新版本后,每次运行我的应用程序时,我都会在控制台中打印此警告:

It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil. This is a programming error. Break on void _NSWarnForDrawingImageWithNoCurrentContext() to debug. This will be logged only once. This may break in the future.



我没有在我的应用程序中的任何地方使用图像,我在整个项目中搜索了图像,但找不到。有谁知道这可能导致什么?

顺便说一句,我正在使用 2 个 nib 文件:一个 Popover 和 Mainwindow。它们都不包含图像。

编辑:
当出现这种情况时,我发现了这一行:
    [self.popover showRelativeToRect:[appDelegate.menulet frame] 
                              ofView:appDelegate.menulet 
                       preferredEdge:NSMinYEdge];

但是这些对象都不是零。有什么建议?

编辑2:
Menulet 是一个 NSView 子类顺便说一句。所以我正在传递一个观点。

最佳答案

我尝试设置断点,但它在 Nib 加载时被调用。所以它是非常非特定的。我创建了一个 Nib 的副本,然后从中一个一个地删除对象,直到警告消失。就我而言,它是一个 NSOutlineView。但是一旦我添加了一个新的 NSOutlineView,错误又回来了。

我终于能够通过手动重建整个 NIB 来消除警告。煞费苦心,但它摆脱了警告。

关于warnings - "Does not make sense to draw an image"- 升级到 Mountain Lion 后出现警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11805741/

相关文章:

macos - "You should probably ` chown`them"是什么意思?

php - MAMP 上的 Gearman PECL 扩展

fortran - 一种在 Fortran 中抑制 "unused dummy argument"警告的便携方法

c - 警告 fprintf

string - 字符串 'eq' Perl 中的未初始化值

Python如何过滤特定警告?

python-2.7 - 卸载 python.org 版本的 python2.7 以支持默认 OS X python2.7

python - Pycrypto 安装 fatal error : gmp. h 文件未找到

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP

macos - Mac - 无法安装 Homebrew