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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to