NSTableView not updating correctly when using bindings in macOS 13.6
I'm maintaining legacy code that I've tried everything I can think of but I'm experiencing an issue with `NSTableView` where changes to the underlying data model are not reflecting in the table view bound to it. I am using Cocoa bindings to connect an `NSArrayController` to my `NSTableView`. While the initial data loads correctly, any updates (like adding or removing items) do not trigger a visual refresh in the `NSTableView`. I have set up my bindings using Interface Builder, and here's how I configured my `NSArrayController`: - `Content Array` is set to my data source array. - `Sort Descriptor` is configured to sort based on a specific attribute. The relevant part of my code looks like this: ```swift @objc dynamic var items: [MyItem] = [] { didSet { arrayController.rearrangeObjects() } } func addItem(_ item: MyItem) { items.append(item) arrayController.addObject(item) } func removeItem(at index: Int) { arrayController.removeObject(atArrangedObjectIndex: index) items.remove(at: index) } ``` I've confirmed that the data model is updating correctly by printing the contents of the `items` array after modifications. Additionally, I've checked that the `NSTableView` is set to observe the `NSArrayController`. However, the `NSTableView` does not refresh visually when I add or remove items. I also tried manually calling `tableView.reloadData()` after modifying the data, but that doesn't resolve the issue. I'm using Xcode 14 and targeting macOS 13.6. Any insights on why the updates arenβt reflecting in the `NSTableView` or how to properly implement the bindings would be appreciated. I recently upgraded to Swift stable. Could this be a known issue? I'm working with Swift in a Docker container on Linux. I'd be grateful for any help.