In TextEdit, if you click the little dropdown next to the filename you get a menu which shows a couple of entries including Rename
, Move to iCloud
, Move To
, Duplicate
, Lock
and finally Browse All Versions
.
I'm wondering how to support this menu? On my app I have the disclosure indictor, but get no menu which I click it. Do I need to add this menu via code? If so, i'm assuming I need to link it to the window somehow, but I don't see a proper place to do so. Any suggestions on what i'm missing?
You get this functionality "for free" when using NSDocument subclasses in document-based applications. As long as you've implemented everything outlined here:
http://developer.apple.com/library/mac/#documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/StandardBehaviors/StandardBehaviors.html
... versioning should "automagically" work as it's directly affected by implementing auto-save.
Things to consider:
Figured it out. I was overriding:
- (void)menuNeedsUpdate:(NSMenu *)menu
I didn't need to be overriding this method, so I removed it. As soon as I did that, my menu started working.