Persistent class data?

I am unsure how a class is meant to be used.

I have a class with a number of values that I would like to update and make persistent, as if to place it into userDefaults. However, it looks as though each value will need to be assigned to a userDefault value itself, but that would be a big headache for me.

Updating the class is really what I would like to do, but how to I make the data persistent?

Thanks.

Using JSON serializer to persist any program data to file.

Thank you Wyvern, very cool information I did not best understand.

I wanted to avoid maintaining parallel data sets, and it seems with JSON data I could do this, but slowly, of which could be sped up if dumped into a dictionary format, which is a lot more work.

However, if I stick with a class based model and save data to user defaults it will be quicker and I only need to monitor those defaults to maintain a single data set.

The JSON route seems to be easier to manage.

Terms of Service

Privacy Policy

Cookie Policy