• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED]Preventing lion from saving state...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Preventing lion from saving state... (From: Matthew Weinstein <email@hidden>)
 >Re: Preventing lion from saving state... (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Large over 100K pixel high ruler scroll view
  • Next by Date: Odd error logged when coming back from 'Browse All Versions'
  • Previous by thread: Re: Preventing lion from saving state...
  • Next by thread: Re: Preventing lion from saving state...
  • Index(es):
    • Date
    • Thread