JDev
JDev

Reputation: 5558

Silence macOS Storyboard warnings in the debugger console

I'm creating a custom NSToolbar, with custom display and sizing (based on your version of macOS), using Storyboards (I know, I know... sue me, but it needs to be done in Storyboards for reasons important to the client).

However, due to all of these custom properties, my console is now getting overloaded with object-clipping warnings:

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.

I have tried implementing my own macOS-variation of the only consistent StackOverflow solutions that I've found, as well as this gist – still no dice.

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

Is there a macOS solution for Cocoa-based Storyboards that will allow me to silence these warnings?

Furthermore, I tried to find a list of those Apple-included UserDefaults, but have not come across any useful resources. Where are developers finding UserDefault keys such as "_UIConstraintBasedLayoutLogUnsatisfiable"?

EDIT: It would be preferable if there were a solution that silenced, for example, only object-clipping warnings or only warnings for this specific NSToolbar/NSWindow. I do NOT want to silence all Storyboard warnings – as this is a last resort.

Upvotes: 2

Views: 175

Answers (0)

Related Questions