Preventing app from being restored or saving info in "Saved Application State"
Preventing app from being restored or saving info in "Saved Application State"
- Subject: Preventing app from being restored or saving info in "Saved Application State"
- From: "Lars C. Hassing via Cocoa-dev" <email@hidden>
- Date: Mon, 11 Nov 2019 01:39:39 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ccieurope.com; dmarc=pass action=none header.from=ccieurope.com; dkim=pass header.d=ccieurope.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+mMfMIgtohYmR2Db0w5+HiyFLpEIuJELnhSYKSH9R0Y=; b=oUUucLuWX3vjGgHgey+7uC8/CbsLvYchlsdgIFqfmfBgb6OFTPZuhGLUtrXwZr9Y2Xw72TsF/3cffLGmxHDIusjV2+S6mLobJWoUpUdRGaIf9UPfxsS0GO7RDN0bmY/y9S3UHaaEqf3Oo9HgZIVsC4fKqrNsdq5CmYXxMBgvmxATxCUEVgHnYU7oDkCMhqTLEJqiNLpRhN7F9Oh+/BZwthdBGdKFcipvnwNCbJXzBCHM5ahQfdbRAvV7sYjDafWRCje64FA9NF0yGy5tnYYL9PtM1M7l0dn7w/QI5kFFnMpa1JUznBYm2x6HGFlzQgTRYpnmgG/8GhWCQA8C0BKFGA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdazG/yygEulu/3XlSxlu6iyth9fKJbRjbmsQ+gSrz74EwgJN5HE75K2scNnAa76izWaXt7focUJs/730imvxokpO/YiFJXHNxg9EojBmBRCDFydYK5YMUWlNOra5UqCHIlaDWCk6i/ITe7Rfj2bjEIHN5ernevFTVLLyZyPo7e4hrr3MshBE0MoJv92vzShBYcYR+Ha45o3MEQUvEL4UtJHARyiSDtc5g5EBcStIHvO+Vj5pvxpqKqvO/6jxYCKcvK1SSoV0x5hBwh4X/+JqvVZtS0b28/KR6JIN9Snz+N5+x2bUn1/SizPxfW0oCU/zl+R8XO0BbB+fpQ2kJhGHw==
- Thread-topic: Preventing app from being restored or saving info in "Saved Application State"
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