I'm looking for a built-in (or easy-to-implement) way to get Core Data undo/redo action names to read like "Undo edit First Name", rather than simply "Undo" or "Redo" as they do by default.
I have a Core Data application, and am using its NSUndoManager
as my window's undo manager. It works great, but when a user makes a change to a field (inline from an NSTableView
), the Undo menu item's title doesn't reflect which field changed.
Initial searching led me to the same question posted on Apple Mailing Lists in January 2007. The only answer ever posted responds with "Search for 'Model.strings' in the Core Data Programming Guide." I didn't have a Strings file for my Model, so I created one (localized in my en.lproj directory and with UTF-16 encoding), but this made no difference.
I followed instructions from Apple's tutorial (adapted slightly since my app is not Document-based), and the Core Data documentation, but my menu titles still read "Undo" and "Redo".
NSLocalizedString
call in your sample won't work though, since that won't look up against the Model.strings file. How would you look up a field's localized name at runtime? – Lonna