Bryanzpope
Bryanzpope

Reputation: 1007

Objective-c iOs Autosaving information when exiting a view

I am programming an ios app and would like to save information on exit of the view. I know how to go about saving the actual information but I'm not sure where I should put the code.

In android, there are methods like onPause() where I can run the save code to capture whenever someone leaves an activity. Is there something in obj-c like that?

Upvotes: 1

Views: 132

Answers (1)

GoodSp33d
GoodSp33d

Reputation: 6282

You can add your logic for saving the state of the view in viewWillDisappear

I guess you have not gone through the View Life Cycle, here s one nice image which has captured the view life cycle events.

enter image description here

Reference : http://rdkw.wordpress.com/2013/02/24/ios-uiviewcontroller-lifecycle/

Upvotes: 5

Related Questions