gpt4 book ai didi

macos - NSToolbarItem: "Make sure this toolbar item has a valid frame/min/max size"?

转载 作者:行者123 更新时间:2023-12-03 16:05:30 25 4
gpt4 key购买 nike

自从升级到 Mac OS Sierra 和新的 XCode 版本后,每次为每个 NSToolbarItems 启动应用程序时,我都会收到以下错误:

Example 1:
2016-09-29 12:46:58.659879 AppTest[] NSToolbarItem (<NSToolbarItem: >) had to adjust the size of <NSPopUpButton: > from {130, 26} to the expected size of {132, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint
Example 2:
2016-09-29 12:46:58.666074 AppTest[] NSToolbarItem (<NSToolbarItem: >) had to adjust the size of <NSButton: > from {60, 25} to the expected size of {62, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint

我尝试在 StoryBoard 中尝试更改大小,但没有成功,当我四处搜索时,我发现有几个人在使用新操作系统时也遇到了这个问题,但没有有用的答案。

有人遇到同样的问题,有什么建议吗?

非常感谢,

马克

最佳答案

无法在界面生成器中解决此问题。然而,在 NSToolbarItem 的子类中重写 minSize 解决了这个问题。

- (NSSize)minSize
{
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) {
/* Overriding this getter seems to be the only solution for runtime error logs like: NSToolbarItem (<APMRegularToolbarItem: 0x60e000039460>) had to adjust the size of <NSButton: 0x60f0001acce0> from {40, 25} to the expected size of {42, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint
*/
return NSMakeSize(42, 27);
}
else {
return [super minSize];
}
}

关于macos - NSToolbarItem: "Make sure this toolbar item has a valid frame/min/max size"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39768476/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com