• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Recently Opened in Doc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recently Opened in Doc


  • Subject: Re: Recently Opened in Doc
  • From: James Merkel <email@hidden>
  • Date: Sat, 28 Jan 2012 14:58:54 -0800

On 28 Jan 2012 08:46:48 -0800 Quincey Morris wrote:

> On Jan 28, 2012, at 08:19 , Brad Stone wrote:
>
>> I have a shoebox app like iPhoto where the actual filename is irrelevant to the user.   I control the file name.
>>
>> What I'd like to do is just capture the menu items before they're displayed and change the menu titles into something relevant to the user.  In the scheme of things it's a minor way to access the info in my app so if I could eliminate them that would be OK too.  Changing the filename is not an option at this point.
>
> It seems to me you can subclass NSDocumentController, then override 'noteNewRecentDocument:' to do nothing. Presumably this will keep your filename off the "Open Recent" submenu, the "Recent Items" item on the Apple menu, and the dock menu. Then you should be able to delete the "Open Recent" item itself, and be left with no traces of recent items from your app.
>
> If you wanted to go the extra mile, you could create your own recent-items implementation, driven from your 'noteNewRecentDocument:' override, and using the 'applicationDockMenu:' application delegate method, with whatever document identifiers you want.


My app is not document based so I call noteNewRecentDocumentURL: directly to add the filename to the Open Recent submenu list.
If I comment that line of code out then the document is not added to the list as expected. Also, the Dock menu "Show Recents" shows nothing and the filename is not added to  the Dock menu list.

So yes, noteNewRecentDocument; (which calls noteNewRecentDocumentURL: ) is the key to the whole thing.

Jim Merkel
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: Key Value Observing of NSMutableArray inside an object
  • Next by Date: Re: Key Value Observing of NSMutableArray inside an object
  • Previous by thread: Re: Recently Opened in Doc
  • Next by thread: How to get the dispatch queue for the current thread's runloop?
  • Index(es):
    • Date
    • Thread