undo.prepare(withInvocationTarget: Any) no longer works and NSArrayController is not updating either in 10.12 & Xcode 8

If you replace the call to undo.prepare(withInvocationTarget: Any) with

undo.registerUndo(withTarget: self) { this in
        this.removeObjectFromEmployeesAtIndex(index)
}

the undo call works. However, the NSArrayController ( and thus the NSTableView) is not observing whatever mechanism it used to observe to be made aware of this call. Therefore, the Table View does not update to reflect the fact that you just undid your add employee.

Edit:

You wouldn’t use the above method, you’d use:

undo.registerUndo(withTarget: self) { this in
        this.arrayController.removeObject(employee)
}

and similar for the remove function.

I fixed this by making employees dynamic. See https://forums.bignerdranch.com/t/completing-adding-undo-to-raiseman-using-swift-3-0 for my complete solution.