Re: [SOLVED]Preventing lion from saving state...
Re: [SOLVED]Preventing lion from saving state...
- Subject: Re: [SOLVED]Preventing lion from saving state...
- From: Matthew Weinstein <email@hidden>
- Date: Tue, 23 Aug 2011 20:06:50 -0700
Graham, that works like a charm. I just put this in my delegate applicationwillfinishlaunching method:
#define NSDEF [NSUserDefaults standardUserDefaults]
if([NSDEF objectForKey: @"ApplePersistenceIgnoreState"] == nil)
[NSDEF setBool: YES forKey:@"ApplePersistenceIgnoreState"];
On Aug 23, 2011, at 3:56 PM, Graham Cox wrote:
>
> On 24/08/2011, at 4:25 AM, Matthew Weinstein wrote:
>
>> My approach has landed up being just as kludgy, and I'm really annoyed that apple has made no way to opt out of this "feature."
>
>
> In Xcode 4, you can configure your scheme to have "disable state restoration" checked. This suggests that there is a switch that can be set that turns this off for an app, either as a defaults setting or maybe as a command-line argument. Unfortunately I can't see exactly how that works, but when the app launches, the log shows:
>
> 23/08/11 1:12:19.951 PM Artboard: ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/_d/fcb3h3892y339vh632v_hz280000gn/T/com.mapdiva.as.Artboard.savedState
>
>
> So perhaps 'ApplePersistenceIgnoreState' is a simple boolean in your defaults that can be set? Worth a try…
>
>
> --Graham
>
>
_______________________________________________
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