On Wed, 24 Aug 2011 08:56:49 +1000, Graham Cox said:
>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/
>So perhaps 'ApplePersistenceIgnoreState' is a simple boolean in your
>defaults that can be set? Worth a try…
You can use it with Xcode 3 too, just pass it as a command line argument with value YES to your executable. But it's not something you should ship with, it's for debugging.
Only windows associated with an NSDocument are restorable by default. It's much safer, as I described before, to just do:
NSWindow* window = [inControllerToAdd window];
if ([window respondsToSelector:@selector(setRestorationClass:)] &&
[window respondsToSelector:@selector(setRestorable:)] &&
every time you add a window to your document.
If you can require Xcode 4.1, you can also turn off the 'restorable' bool in IB's inspector for your document windows. But this may make your nibs not work with older tools, I'm not sure. I need to edit my nibs on 10.5, and so didn't go that route.
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
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