Search code examples
macoscocoansdocumentautosave

Cocoa - Adding menu to support versions? (Like in TextEdit)


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.

TextEdit

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?

SQL


Solution

  • 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.