【问题标题】:NSRemoteView generates a strange message in the LogNSRemoteView 在 Log 中生成一条奇怪的消息
【发布时间】:2017-01-29 17:03:30
【问题描述】:

当我在 macOS Sierra 中运行我的沙盒应用程序时,我在日志中发现了这条消息:

2016-09-21 12:08:42.787003 MyApp[1505:63581] warning: <NSRemoteView: 0x610000123160> determined it was necessary to configure <NSVBSavePanel: 0x103e002a0> to support remote view vibrancy

我在 OS X 10.11 中看不到此消息。

当应用程序显示一个覆盖主窗口的 NSSavePanel 时,似乎会出现此消息。

我已经验证了包含该窗口的 .xib 文件,我在 Xcode 的文档和 Google 中进行了搜索,但没有找到任何解决问题的方法。

9 月 22 日添加

只要我在方法中声明了 NSSavePanel :

NSSavePanel     *panel = [NSSavePanel savePanel];

消息被发送到日志中。

【问题讨论】:

  • 我目前在使用 NSOpenPanel 时遇到同样的问题。其余的和你描述的一样。如果我有新发现会通知你。
  • @Daniel 我已经向 Apple 提交了错误报告。如果我有答案,我会在这里发布。
  • 这里有同样的问题。在日志中出现错误后,您的应用程序是否也崩溃或运行正常?我正在调查我的应用在 macOS Sierra 上的一些崩溃问题。
  • @JacobGorban、Daniel 和 Mark,我的 macOS 应用程序在选择文件后有时也会卡住,但并非总是如此,这很奇怪!但是在我打开“应用沙盒”功能并在“用户选择的文件”下的沙盒权限上选择“只读”后,我的应用再也没有卡住了!关于原来的线程问题,我我也收到了该日志消息。
  • 似乎这是一个严重的问题,与 NSOpenPanel 相同的警告,但这是面板关闭后最糟糕的崩溃,我需要从沙箱读取/写入文件夹访问权限,通过 Xcode 添加适当的权利,急需解决方案:(

标签: objective-c xcode cocoa


【解决方案1】:

macOS 应用程序遵循沙盒模式。这意味着您需要明确地允许您的应用程序读取/写入文件,否则您会遇到权限问题并触发一些错误(其中一个是您已下划线的警告形式)。

在应用程序的“功能”选项卡上,确保至少启用一种文件访问方法。

【讨论】:

  • 好主意,但似乎不是问题所在。至少不适合我。
  • Form me 仅在 .entitlement 文件中的所有条目都设置为读/写时才有效。
【解决方案2】:

尝试在这里找到答案:

另外,可能会有所帮助:

<key>com.apple.security.scripting-targets</key>
    <dict>
        <key>com.apple.security.temporary-exception.apple-events</key>
        <array>
            <string>com.apple.terminal</string>
            <string>com.googlecode.iterm2</string>
            <string>com.apple.finder</string>
        </array>
    </dict>
    <key>com.apple.security.temporary-exception.shared-preference.read-write</key>
    <array>
        <string>com.apple.finder</string>
    </array>
    <key>com.apple.security.temporary-exception.apple-events</key>
    <array>
        <string>com.apple.terminal</string>
        <string>com.googlecode.iterm2</string>
        <string>com.apple.finder</string>
    </array>
</dict>

!!! 如果您尝试提交到 AppStore 会被告知苹果不允许这样做:

  • com.apple.security.temporary-exception.apple-events 和
  • com.apple.security.temporary-exception.apple-events

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多