discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac compatility problem: recent items menu


From: Riccardo Mottola
Subject: Re: Mac compatility problem: recent items menu
Date: Sun, 07 Dec 2014 15:23:27 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:34.0) Gecko/20100101 Firefox/34.0 SeaMonkey/2.31

Hi,

Dr. H. Nikolaus Schaller wrote:
The Recent Items menu is almost undocumented and handled automatically inside 
of NSDocument. So if you start a DBA project from scratch you wont have to 
write any line of code or configure anything to make the recent items work.
That's what my projects are. I tried a totally new from-scratch skeleton app and it does work (just to prove the OS is not broken, it just expects "something"(.
I can think of some potential undocumented “rules” which have changed between 
Mac OS versions:

* the location of the menu items in the NSMenu
* the selector of the Recent Menu’s item (might have to be a specific one)
* the menu might have (had) to be “preinitialised” with empty entries
* if your subclass NSDocument, there might be a fixed name for the (internal) 
method(s) that handle the recent items - so if you overwrite some public method 
it might break recent items because the NSDocument’s internal method isn’t 
called any more
* the format of storage in the NSUserDefaults

So there is some relation between the NIB template for a DBA and NSDocument. A 
NIB file just “inherited” from older development systems might be broken on 
newer ones.

I.e. you could try to rebuild the NIB file from a fresh template (to save work 
it could remain incomplete) and check if the recent items behave differently. 
If they do it is a hint where to look deeper.
I tried making a minimal new MainMenu.nib, no help. I also tried to remove "Open Recent". AppKit will re-insert it if there is an "Open..." one :) That way the selectors should be certainly right: AppKit itself put them in!

I removed the NSUserDefaults. It had no recent documents inside anyway.

The path that remains most probable is this NSDocument, the only thing I subclass. But what could be missing?? Or what could I have overridden that Apple doesn't like anymore?

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]