Ability to add numbers

I want to make something that adds numbers over and over again.

If you add 50 at the beginning, it is saved in the core data, and if you add 80 again later, I want 130 to be saved in the core data right away.

How do I store the stored value directly in Core Data and add another number to that data?

I understand it is just an exercise to learn CoreData. Otherwise, there are simpler ways to do it.

The simplest:

  • at load, you retrieve data fromCoreData
  • You keep it in a var : total: Int
  • each time you add, you increment this var
  • you can save immediately in CoreData or save when you quit the app.

What is the point you don't know how to do ?

Ability to add numbers
 
 
Q