Re: Open Recent menu in non-doc app
Re: Open Recent menu in non-doc app
- Subject: Re: Open Recent menu in non-doc app
- From: John Nestor <email@hidden>
- Date: Fri, 22 Mar 2002 13:42:02 -0500
Thanks for the responses. Should keep me off the streets for a bit.
A quibble with the documentation, however. The Document Controller
documentation reads as below - which misled, me at least, into believeing
that use of - (void)noteNewRecentDocumentURL:(NSURL *)anURL
was sufficient. It seems that it is not
- (void)noteNewRecentDocumentURL:(NSURL *)anURL
This method should be called by non NSDocument-based apps when they
open/save documents. NSDocument automatically calls this method when
appropriate for NSDocument-based apps. You can override this in an
NSDocument-based application to prevent certain kinds of documents from
getting into the list (but you have to identify them by their URL).
Ali Ozer wrote:
>
>>The menu is populated properly by calling
>
>>
>
>>[[NSDocumentController sharedDocumentController]
>
>>noteNewRecentDocumentURL: [NSURL fileURLWithPath:path] ];
>
>>
>
>>as soon as path is available.
>
>>
>
>>If I try to use the Open Recent menu I get the following error panel
>
>>
>
>>The recent document "EiffelTower_even_smaller.tif" in folder
>
>>"/Users/jnesto02/Smaller samples" failed to open.
>
>>
>
>The menu is being populated properly, but the items that get put in the
>
>menu are still going to be set up so that they try to open up an
>
>NSDocument, and since you don't have any of that set up, the call fails
>
>because NSDocumentController can't find any NSDocument class to use to
>
>open up the file. This can probably be solved by subclassing
>
>NSDocumentController and overriding the
>
>openDocumentWithContentsOfFile:display: method. To get your subclass
>
>to be used as the shared NSDocumentController, you should instantiate
>
>it in your main nib file.
>
>
>
>
TextEdit uses the NSDocument recent menu stuff without an
>
NSDocumentController. The open requests end up going through the
>
NSApplication open delegate method. Just implementing that might be
>
enough.
>
Ali
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.