Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash due to toolbar in OnThisDay app under macOS Sequoia 15.1 #2

Open
trozware opened this issue Aug 30, 2024 · 1 comment
Open

Crash due to toolbar in OnThisDay app under macOS Sequoia 15.1 #2

trozware opened this issue Aug 30, 2024 · 1 comment

Comments

@trozware
Copy link
Owner

Report from Steve Hayman:

I'm on Sequoia 15.1 Beta (24B5024e) and if I open and launch the On This Day sample code from 03-adding-menus-and-toolbars/final, it somehow crashes when I choose File > New Window .

Any idea why that might be happening? It doesn't seem to happen in Sonoma, but on the Sequoia beta it crashes with some complaint about a duplicate toolbar menu item. I took a brief look on Sonoma and it didn't seem to happen there so perhaps this is a Sequoia bug.

FAULT: NSInternalInconsistencyException: NSToolbar 0x60000356fc30 already contains an item with the identifier com.apple.SwiftUI.navigationSplitView.toggleSidebar. Duplicate items of this type are not allowed.; {

Crash log attached:
crash_log.txt

@trozware
Copy link
Owner Author

This looks to be an internal error since the duplicate identifier is com.apple.SwiftUI.navigationSplitView.toggleSidebar.
It would appear to be related to the toggle sidebar toolbar button that NavigationSplitView adds automatically.

Steve did some further tests and found two solutions:

  1. Change CustomizableToolbarContent to ToolbarContent. This removes the ability to customise the toolbar, but it stops the crash.

  2. Move the .toolbar modifier up so it is applied to the detail view instead of to the NavigationSplitView. Toolbar modifiers can go almost anywhere and you can have multiples. The toolbar items will only appear if the view they are attached to is visible. In this case, the detail view will always appear whenever the NavigationSplitView appears, so it doesn’t matter.

To my surprise, removing the automatic sidebar toggle didn't work. It must still be there but just not visible.

I still think this is a bug in Sequoia and when I get back to my beta Mac, I will do some more tests, but for now, these workarounds should help.

Many thanks to Steve for reporting the bug and working out these two options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant