Yes. As documented in the Lion AppKit release notes, you can set the ApplePersistenceIgnoreState
user default for your application. (The docs imply that the value isn't significant; it just needs to be set to something.)
An easy way to do this for debug runs only, while preserving the state restoration feature when you use your app normally, is to set it in Xcode. In your scheme's Run action, set a command-line argument for -ApplePersistenceIgnoreState
, and, immediately after it, another one with the value (e.g., YES
). This makes use of AppKit's feature of reading user defaults from the command-line.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…