macOS 26: NSTokenField crashes due to NSGenericException caused by too many Update Constraints

This example application crashes when entering any text to the token field with

FAULT: NSGenericException: The window has been marked as needing another Update Constraints in Window pass, but it has already had more Update Constraints in Window passes than there are views in the window.

The app uses controlTextDidChange to update a live preview where it accesses the objectValue of the token field.

If one character is entered, it also looks like the NSTokenFieldDelegate methods

tokenField(_:styleForRepresentedObject:) tokenField(_:editingStringForRepresentedObject:) tokenField(_:representedObjectForEditing:)

are called more than 10000 times until the example app crashes on macOS Tahoe 26 beta 6.

I've reported this issue with beta 1 as FB18088608, but haven't heard back so far.

I have multiple occurrences of this issue in my app, which is working fine on previous versions of macOS. I haven't found a workaround yet, and I’m getting anxious of this issue persisting into the official release.

We're also having the same issue. Have you heard anything back from Apple on this?

No reply from Apple and no similar reports in the Feedback app, as usual. I also gave up on updating my feedback with each beta, it's just too frustrating.

Instead, I rewrote everything to use strings instead of a custom token type. It requires more parsing passes, but it doesn't crash.

Hope this path is also an option for you!

I have now submitted a report to Apple as well as FB21540400 if you would like to update them to say they have at least 1 similar report.

Thanks for the advice - I will take a look :)

macOS 26: NSTokenField crashes due to NSGenericException caused by too many Update Constraints
 
 
Q