Basically, without implementing these methods everything works fine.
I add undo actions with
undoManager?.registerUndoWithTarget(self, selector: #selector(ViewController.toggleUndoAddTask(_:)), object: params)
if !undoManager!.undoing {
undoManager?.setActionName(kActionNameAddTask)
}
and the menu titles of the undo/redo actions are then 'Undo kActionNameAddTask' or whatever the name of the action was set.
However, after implementing
@IBAction func undo(sender: AnyObject) {
undoManager?.undo()
}
the menu titles are now simply 'Undo' or 'Redo', i.e. without action names.
If I query undoManager, the undoActionName and the undoMenuItemTitle are both set correctly.
Did I miss something that is preventing these titles from working?