Xcode 12b2 storyboard crash inserting bar button item at first position to toolbar that has an existing item

Originator:indiekiduk
Number:rdar://FB8039921 Date Originated:17/7/20
Status:Open Resolved:No
Product:Xcode Product Version:12b2
Classification:Crash Reproducible:Always
 
I'd like to report a crash in the storyboard when inserting a bar button item to the first position of a toolbar that has an existing item.

Attachments:
Screenshot showing the storyboard and an overlay of simple instructions to cause the crash.
An example crash log from the crash.
A sample project to recreate the crash.

Please list the steps you took to reproduce the issue:
1. Open attached project named Difffable-Collection.
2. Select Main.storyboard
3. Position canvas so the Master view controller and its toolbar with the existing Delete button is visible.
4. Click the + button in the top right of window.
5. Search for "bar button item" and drag it to the left side of the Delete button in the toolbar.

What did you expect to happen?
New button should be added to toolbar.

What actually happened?
Xcode crashes.

Process:               Xcode [3306]
Path:                  /Applications/Xcode-beta.app/Contents/MacOS/Xcode
Identifier:            Xcode
Version:               12.0 (17175.2)
Build Info:            IDEFrameworks-17175002000000000~10 (12A6163b)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [3306]
User ID:               504

Date/Time:             2020-07-17 08:15:30.140 +0100
OS Version:            Mac OS X 10.15.5 (19F101)
Report Version:        12
Anonymous UUID:        59B7634D-13EF-1536-F9BD-27644F25A641

Sleep/Wake UUID:       183A880B-483B-48C0-A81A-7B1B03D6106B

Time Awake Since Boot: 1100000 seconds
Time Since Wake:       1500 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 12A6163b
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-17105.1/InterfaceBuilder/WidgetIntegration/IBUIToolbar/IBUIToolbarEditingPolicy.m:283
Details:  This editing policy can only work with bar button items it contains.
Object:   <IBUIToolbarEditingPolicy: 0x7fa1b71a98e0>
Method:   -shouldChildHaveResizeKnobs:
Thread:   <NSThread: 0x7fa1af81a6c0>{number = 1, name = main}
Open FDs: 86/9472
Hints:   
 
Backtrace:
  0   -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   -[IBUIToolbarEditingPolicy isFrameLockedForButtonBarItem:] (in IDEInterfaceBuilderCocoaTouchIntegration)
  4   -[IBUIViewControllerEditor shouldChildHaveResizeKnobs:] (in IDEInterfaceBuilderCocoaTouchIntegration)
  5   -[IBViewEditor objectShouldShowSelectionHighlight:] (in IDEInterfaceBuilderKit)
  6   -[IBEditor decorationInsetForChild:] (in IDEInterfaceBuilderKit)
  7   -[IBViewEditor decorationInsetForChild:] (in IDEInterfaceBuilderKit)
  8   -[IBEditor setDecorationsNeedDisplayForObject:] (in IDEInterfaceBuilderKit)
  9   -[IBEditor selectionOwner:didSelect:andDeselect:] (in IDEInterfaceBuilderKit)
 10   -[IBViewEditor selectionOwner:didSelect:andDeselect:] (in IDEInterfaceBuilderKit)
 11   -[IBSelectionOwner didSelect:andDeselect:] (in IDEInterfaceBuilderKit)
 12   -[IBSelectionOwner primitiveUpdateSelection:] (in IDEInterfaceBuilderKit)
 13   -[IBSelectionOwner selectObjects:byExtending:andToggling:] (in IDEInterfaceBuilderKit)
 14   -[IBCanvasViewController selectObjectsInEditor:scrollSettings:] (in IDEInterfaceBuilderKit)
 15   -[IBEditorCanvasFrameController dragTarget:didAcceptDraggedObjects:fromDragInfo:context:] (in IDEInterfaceBuilderKit)
 16   -[IBEditorCanvasFrameController performDragOperation:] (in IDEInterfaceBuilderKit)
 17   -[IBEditorCanvasFrame performDragOperation:] (in IDEInterfaceBuilderKit)
 18   DVTTrackDragging (in DVTUserInterfaceKit)
 19   -[DVTDragManager dragImage:at:mouseDownEvent:pasteboard:allowedOperations:source:slideBack:draggingSourceContext:] (in DVTUserInterfaceKit)
 20   -[DVTDragManager dragImage:at:offset:mouseDownEvent:mouseDraggedEvent:pasteboard:allowedOperations:source:slideBack:draggingSourceContext:] (in DVTUserInterfaceKit)
 21   -[DVTLibraryController dragAssets:withMouseDownEvent:mouseDraggedEvent:initialDraggedImageState:allowedOperations:imageLocationInWindow:] (in DVTLibraryKit)
 22   -[DVTLibraryController libraryTileView:dragItems:primaryItem:withMouseDownEvent:andMouseDraggedEvent:] (in DVTLibraryKit)
 23   LibraryTileView.LibraryCollectionView.mouseDragged(with:) (in DVTLibraryKit)
 24   @objc LibraryTileView.LibraryCollectionView.mouseDragged(with:) (in DVTLibraryKit)
 25   forwardMethod (in AppKit)
 26   forwardMethod (in AppKit)
 27   forwardMethod (in AppKit)
 28   forwardMethod (in AppKit)
 29   -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] (in AppKit)
 30   -[NSWindow(NSEventRouting) sendEvent:] (in AppKit)
 31   -[IDESearchPanel sendEvent:] (in IDEKit)
 32   -[NSApplication(NSEvent) sendEvent:] (in AppKit)
 33   -[IDEApplication sendEvent:] (in IDEKit)
 34   -[NSApplication run] (in AppKit)
 35   NSApplicationMain (in AppKit)
 36   start (in libdyld.dylib)

Comments

Still exists in Xcode 12b6

In the sample project, storyboard please select the split view controller and change column style from unspecified to double. Otherwise a new bug causes the toolbar items not to appear which is necessary to test this bug.

By indiekiduk at Aug. 26, 2020, 3:48 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!