osx - How to deactivate window restoration? -
i using sdk 10.8.
i subclassing nspersistentdocument
(but question might interest people sublassing nsdocument
) , want deactivate window restoration. far, here have done :
-(void)restorestatewithcoder:(nscoder *)coder { nslog(@"no 1") ; } -(void)restoredocumentwindowwithidentifier:(nsstring *)identifier state:(nscoder *)state completionhandler:(void (^)(nswindow *, nserror *))completionhandler { nslog(@"no 2") ; }
the problem when try in application create new document, no window shown.
what proper way desactivate window restoration ?
this function of window restoration makes app unlaunchable, instance after crash (or click stop in xcode). don't want users of app face same problem , unable launch anymore app.
that should true if stored state corrupt or you've changed keys store under.
in normal circumstances, state restoration exists save user data (that haven't manually saved) in event of crash—your users want there when app crashes on them.
for debugging purposes, can disable state restoration in xcode scheme:
Comments
Post a Comment