Save Values AUTOMATICALLY with NSUserDefaults

Posted by Edouard Tarter on Stack Overflow See other posts from Stack Overflow or by Edouard Tarter
Published on 2013-10-25T15:37:33Z Indexed on 2013/10/25 15:54 UTC
Read the original article Hit count: 144

Filed under:
|
|

I have an app with two UITextFields, where the user enters an integer, and then a method is called with the values the user enters. But when I completely close the app, the values are deleted. I want to change it to save the value the user entered when it closes, and loads it up when the app is re-opened. I tried this with NSUserDefault, and it worked fine (with save and load button), but I want it to make it automatically, without pressing any buttons. I saw some other people do it with the basic methods in the AppDelegate.m, but I don't know anything about that, therefore I didn't understand it at all.

I saw MANY tutorials online, but I didn't understand any of them, please help, and give a detailed answer, thanks :)

© Stack Overflow or respective owner

Related posts about ios

Related posts about iphone