objective c - How to Persist Application State in cocoa -
i need store state of application @ application termination time, when user re-run app, app run state in closed last time. kind of restoring app restore methods called when app close unexpectedly. need restore app each time when close unexpectedly of user close manually. need store app ui not data of application. idea helpful me. thanks
- (nsapplicationterminatereply)applicationshouldterminate:(nsapplication *)sender { //savedata return nsterminatenow; }
if want save nswindow position , can use [window saveframeusingname:@"mywindow"];
, use
[window setframeautosavename:@"mywindow"];
@ app launch.
Comments
Post a Comment