• 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: Preventing app from being restored or saving info in "Saved Application State"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing app from being restored or saving info in "Saved Application State"


  • Subject: Re: Preventing app from being restored or saving info in "Saved Application State"
  • From: "David M. Cotter via Cocoa-dev" <email@hidden>
  • Date: Mon, 11 Nov 2019 10:30:40 -0800

i too have this question

> On Nov 10, 2019, at 5:39 PM, Lars C. Hassing via Cocoa-dev
> <email@hidden> wrote:
>
> I have developed two Cocoa apps, one launching the other helper app.
>
> If number two app crashes then macOS may ask the user if he wants to relaunch
> it,
> but it makes no sense launching it on its own, because it must be launched in
> a controlled manner and environment from the first app.
>
> I believe data in "~/Library/Saved Application State" is being used for this,
> how can I programmatically in app two tell that restoration is not useful ?
>
> I’ve tried myMainWindow.restorable = NO.
>
>
> I’ve learned that you can do
>   defaults write com.mycompany.myapp2 NSQuitAlwaysKeepsWindows -bool false
> but I cannot ask users to open Terminal.
>
> Maybe I could use
>   [NSUserDefaults.standardUserDefaults setBool:NO forKey:@“
> NSQuitAlwaysKeepsWindows”];
> but i hope there is another way
> /Lars

_______________________________________________

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 app from being restored or saving info in "Saved Application State" (From: "Lars C. Hassing via Cocoa-dev" <email@hidden>)

  • Prev by Date: Re: Thoughts on Objective-C++
  • Next by Date: Re: Thoughts on Objective-C++
  • Previous by thread: Preventing app from being restored or saving info in "Saved Application State"
  • Next by thread: Re: Preventing app from being restored or saving info in "Saved Application State"
  • Index(es):
    • Date
    • Thread