微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使调试器控制台中的 macOS Storyboard 警告静音

如何解决使调试器控制台中的 macOS Storyboard 警告静音

我正在创建一个自定义 NSToolbar,具有自定义显示和大小(基于您的 macOS 版本),使用 Storyboards(我知道,我知道......起诉我,但出于重要原因需要在 Storyboards 中完成)给客户)。

但是,由于所有这些自定义属性,我的控制台现在因对象裁剪警告而过载:

2021-02-10 09:47:47.293075-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.293154-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.294598-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.294663-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.295465-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.295524-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.300350-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.300413-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.305839-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.305915-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.306702-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.
2021-02-10 09:47:47.306761-0500 Demo[27503:2117437] [NSToolbarItem] NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.

我已经尝试实现我发现的唯一一致的 StackOverflow solutions 以及 this gist 的我自己的 macOS 变体 - 仍然没有骰子。

UserDefaults.standard.setValue(false,forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")

是否有针对基于 Cocoa 的 Storyboard 的 macOS 解决方案可以让我消除这些警告?

此外,我试图找到 Apple 包含的 UserDefaults 的列表,但没有找到任何有用的资源。开发人员在哪里可以找到诸如 "_UIConstraintBasedLayoutLogUnsatisfiable" 之类的 UserDefault 键?

编辑:如果有一个静音的解决方案会更好,例如,对象裁剪警告或警告这个特定的 NSToolbar/NSWindow。我不想想要关闭所有故事板警告 - 因为这是最后的手段。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。