• 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: Quincey Morris via Cocoa-dev <email@hidden>
  • Date: Mon, 11 Nov 2019 16:50:30 -0800

On Nov 10, 2019, at 17:39 , Lars C. Hassing via Cocoa-dev
<email@hidden> wrote:
>
> 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.

The thing that’s relaunching your app isn’t state restoration, which is only
about restoring state of and within windows.

If you’re talking about the “Reopen” button in the dialog that says your app
crashed, I think that’s CrashReporter or some similar system component, and I’m
not aware of any way of controlling the buttons it offers you.

So, the answer depends on what you’re asking.

— If you’re asking whether it’s possible to suppress the option to relaunch the
crashed app, then no, I don’t believe there is.

— If you’re asking whether it’s possible for the app to suppress state
restoration, if it’s launched via *any* unexpected mechanism, then I think
you’re barking up the wrong tree. It’s just as wrong for your app to relaunch
without state restoration as it to relaunch with state restoration. You would
need to find a way of detecting that it was not launched by the correct base
app (e.g. inter-process communication with that app, if it’s running), but I
doubt there’s any built-in thing you could use for that either.

_______________________________________________

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: Swift -> Obj-C: return __kindof Something
  • Next by Date: Re: Thoughts on Objective-C++
  • Previous by thread: Re: Preventing app from being restored or saving info in "Saved Application State"
  • Next by thread: Thoughts on Objective-C++
  • Index(es):
    • Date
    • Thread