MacOS, Swift, TabViewController, StoryBoard, Delete Object, Crash

MacMini (M1) with Xcode (12.5.1), and Big Sur (11.5.2).

I am exploring different avenues to illustrate my application’s multiple tuple value occurrence results between tableView columns:

1.	The application provides a method to display each resultant value occurrence as an array of dictionary objects (tuples) within a new tableView.
2.	The application provides separate viewControllers to illustrate the different resultant data sources with different record counts.
3.	The application wants each tableView aligned within an associated tabView.
4.	Engaging “NSTabViewController” with the object’s separate viewControllers seemed logical.

That said, I have a repeatable fault issue with NSTabViewController, as follows:

1.	I add a windowController and associated viewController to the application storyboard to control the window.
2.	I add a containerView to the windowController - viewController.
3.	I add an “NSTabViewController” to the application storyboard.
4.	I try to connect (imbed) the “NSTabViewController” to the containerView.
5.	The application crashes with immediate effect.
6.	Xcode illustrates an error report moments later, where I acknowledge the report, and the report is sent to Apple.
7.	The application restarts, I want to delete the “NSTabViewController,” I touch the object, and the application crashes once again.
8.	Very repeatable, and I send another report to Apple.

Caveat (somewhat):

1.	I resurrect a previous unblemished application copy from my back-up storage.
2.	I repeat the same storyboard process.
3.	I add four (4) more viewControllers to the “NSTabViewController” as a viewController limit test, where the total is now six (6).
4.	I connect (imbed) the “NSTabViewController” to the containerView.
5.	The application does NOT crash. - (at least not yet)
6.	I save the application, and restart the application.
7.	I try to add one more viewController to the “NSTabViewController,” again as a viewController limit test.
8.	The application crashes again with immediate effect.
9.	The application restarts, where I want to delete the “windowController et al grouping.”
10.	This time, I touch the connected windowController object, and the application crashes.
11.	Very repeatable, and I send another report to Apple.

So, I have a partial crash report from a a previous session listed below, where the original happens to be too long to post, and unfortunately I do not understand what this report tells me could be the cause of the repeatable issue. I notice the report states “a different number of items than controllers,” and the comment “this shouldn’t happened.” Again, and for the moment, just a current lack of “Swift knowledge.”

Just curious whether this is a known bug with “NSTabViewController” in macOS, or an obvious method error by me … ?

Your suggestions are welcome.

Best regards,

jim_k

The_TabViewController_Crash_Report_(210817)

Process: Xcode [568] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 12.5.1 (18212) Build Info: IDEFrameworks-18212000000000000~4 (12E507) App Item ID: 497799835 App External ID: 842555601 Code Type: ARM-64 (Native) Parent Process: ??? [1] Responsible: Xcode [568] User ID: 501

Date/Time: 2021-08-17 19:07:32.259 -0600 OS Version: macOS 11.5 (20G71) Report Version: 12 Anonymous UUID: B35E6E7E-0543-C17D-0AF0-F408BA4CDFDC

Time Awake Since Boot: 120 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: 12E507 ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-18122/CocoaIntegration/WidgetIntegration/TabViewController/IBNSTabViewControllerIntegration.m:316 Details: We have a different number of items (4) than controllers (3). This shouldn't happend. Object: <IBNSTabViewController: 0x16e285760> Method: -ibTitleForItemAtIndex: Thread: <NSThread: 0x12f629f90>{number = 1, name = main} Open FDs: 43/7168 Hints:
0: DVTControllerContentView_ControlledBy_IBInspectorViewController 1: IDEUtilityDisclosureView 2: DVTStackView_ML

I have/had a very similar issue. It does not crash when I touch the tab controller but it does/did crash when I try to add or remove view controllers from ANY tab controller. The crashing recently started. I was able to add more view controllers by doing the following. I have no idea why it worked.

Xcode 13.2(13C90)

  1. Create a new macOS project.
  2. Add a tab view controller to the storyboard and add several view controllers to it.
  3. Add another tab view controller and connect it to the first tab view controller.
  4. Add several view controllers to that new tab view controller.
  5. Quit Xcode.
  6. Reopen the new project and see if you can add a new view controller to one of the tab controllers.
  7. Quit Xcode.
  8. Open the original project that you encountered the problem and see if the problem is fixed. It was for me.

Again, I have no clue why this worked but if I knew why then it wouldn't be a bug... It would be a feature. Amiright? 😁

I hope this helps someone continue with their project.

MacOS, Swift, TabViewController, StoryBoard, Delete Object, Crash
 
 
Q