Re: NSRecentDocumentRecords
Re: NSRecentDocumentRecords
- Subject: Re: NSRecentDocumentRecords
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 21 Sep 2002 21:55:26 +0100
On Saturday, September 21, 2002, at 09:04 pm, Ali Ozer wrote:
Does anyone know how to access NSRecentDocumentRecords? It's
completely undocumented, as far as I can gather. What I'm trying to
figure out is how to manipulate the number of recent documents an
application remembers in its Recent Items submenu. I can't find
anything in any of the application, document or file-related
documentation, and NSRecentDocumentRecords is the only clue I've been
able to pick up (it's an array doc-based apps put into defaults).
There is a user default you can use: NSRecentDocumentsLimit. Best is
to register your default value for this (a string containing an integer
value) early in your application launch with NSUserDefaults using
registerDefaults:. This is not documented but probably should be,
I'll look into that.
Thanks Ali. For the benefit of the archive, the code I've used (in my
NSDocument subclass's -init method) is this:
NSUserDefaults *defaults;
NSDictionary *appDefaults;
defaults = [NSUserDefaults standardUserDefaults];
appDefaults = [NSDictionary dictionaryWithObject:@"15"
forKey:@"NSRecentDocumentsLimit"];
[defaults registerDefaults:appDefaults];
It has the desired effect. Thanks again.
-Jeremy
========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.