Store data locally iOS

I have a UIViewController so that the user can enter their data and send it to our ASP.NET Webapi. There are about 40 text fields and other controls.

Is there a way to save the input locally. data will not be cleared until the user clicks the submit button. I want the data still there, even rebooting the phone or restarting the program. save to xml?

+4
source share
3 answers

There are several options that you can choose from complexity:

, Data Access Object (DAO), . :

- (Customer*) findCustomByLastName:(NSString*)lastName
- (void) save:(Customer*)customer

., , , , , . DAO NSKeyedArchiver.

:

+6

NSUserDefaults SQLite. SQLite, . , YouTube/apple dev docs

+1

Check out Realm

A mobile database that works directly on phones, tablets or wearables. Realm allows you to create applications faster, create applications faster, and make previously impossible experiences.

+1
source

Source: https://habr.com/ru/post/1535665/


All Articles