You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Content hugging priorities must be positive.'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff801a4ed86 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff801541321 objc_exception_throw + 48
2 CoreFoundation 0x00007ff801a4ec26 +[NSException raise:format:] + 214
3 AppKit 0x00007ff805ed1a52 -[NSView(NSConstraintBasedLayoutInternal) setContentHuggingPriority:forOrientation:] + 96
4 libffi.dylib 0x00007ff812d5d892 ffi_call_unix64 + 82
5 main 0x0000000100f7f4f0 runtime.zerobase + 0
)
libc++abi: terminating due to uncaught exception of type NSException
SIGABRT: abort
PC=0x7ff8018c77a2 m=0 sigcode=0
signal arrived during cgo execution
...
The cause of this error may be setting a negative priority when using Auto Layout.
But there seems to be no problem with the parameters of SetContentHuggingPriorityForOrientation.
Wondering why.
I found that the data type of LayoutPriority is not correct. LayoutPriority should be 32-bit floating point number, while appkit go enum define it as 64-bit:
typeLayoutPriorityfloat64
Changing it to float 32 fixes crash for SetContentHuggingPriorityForOrientation.
@hsiafan Thanks for figuring this out. I thought I had tried this before, but I guess not. I would love a PR to fix the generation code on this if you're willing.
roberte3
pushed a commit
to roberte3/macdriver
that referenced
this issue
Apr 25, 2024
go run ./macos/_examples/layout/main.go
Error:
The cause of this error may be setting a negative priority when using Auto Layout.
But there seems to be no problem with the parameters of SetContentHuggingPriorityForOrientation.
Wondering why.
The text was updated successfully, but these errors were encountered: