• 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: NSDocumentController recentDocumentURLs hiding non-file based URLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocumentController recentDocumentURLs hiding non-file based URLs


  • Subject: Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • From: Ashley Clark <email@hidden>
  • Date: Sat, 14 Apr 2007 21:04:38 -0500

On Apr 14, 2007, at 12:36 AM, Andrew Bush wrote:

Im trying to use the NSDocumentController's builtin open recent stuff with a program that loads its documents via the http protocol. Ive noticed in the past that the open recent list hidces urls whose contents are not directly accessible via the file system.....for instance in XCode projects available via networked drives disappear when the networked drives aren't mounted.

so anyway, this apparently intelligent behavior is biting me in the bum at the moment as a large number of the documents the application Im writing come directly from http based urls, and hence (at least I assume this is the reason why) aren't showing up in the list.

is there some way to change this behavior to allow pretty much any recent document to be shown whether it 'exists' or not.

I've done something similar in my project to allow my recent documents to include non-file based URLs also.


The only way I found to do this was with a subclass of NSDocumentController. There's a few things you'll need to do in your implementation.

1. Implement some methods to read and store your list of recent documents.
2. You'll need to override several methods:
-clearRecentDocuments:
-recentDocumentURLs
-noteNewRecentDocumentURL:
-validateUserInterfaceItem:
3. You'll also need to setup a delegate for your Open Recent NSMenu (not NSMenuItem) that will either use menuNeedsUpdate: or menu:updateItem:atIndex:shouldCancel: and numberOfItemsInMenu: to manipulate the titles of your saved URLs in the Open Recent menu.


If you want more help I can send you some of my code for those methods.

Ashley



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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

  • Follow-Ups:
    • Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
      • From: Andrew Bush <email@hidden>
    • Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
      • From: Andrew Bush <email@hidden>
References: 
 >NSDocumentController recentDocumentURLs hiding non-file based URLs (From: Andrew Bush <email@hidden>)

  • Prev by Date: Re: NSString and NSMutableString
  • Next by Date: change NSView background color
  • Previous by thread: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • Next by thread: Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • Index(es):
    • Date
    • Thread