Re: Open untitled file in Document-based app
Re: Open untitled file in Document-based app
- Subject: Re: Open untitled file in Document-based app
- From: Sean McBride <email@hidden>
- Date: Fri, 26 Oct 2012 09:59:30 -0400
- Organization: Rogue Research Inc.
On Wed, 24 Oct 2012 22:26:59 +0200, ecir hana said:
>> That restoring state stuff is new in 10.7, not 10.8. You can test if it
>> is responsible by turning it off in System Preferences > General.
>>
>>
>Yes, it is! When I turn it off (Close windows when quitting an application)
>it works as before. Is it possible to have the same behavior even when a
>user has the restoring state stuff enabled?
Yes. It's been discussed on this list in the past, and should be in the archives. Basically:
if ([window respondsToSelector:@selector(setRestorationClass:)] &&
[window respondsToSelector:@selector(setRestorable:)] &&
[window respondsToSelector:@selector(invalidateRestorableState)])
{
[window setRestorationClass:Nil];
[window setRestorable:NO];
[window invalidateRestorableState];
}
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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