What is the best way to create and handle a sequential relationship in CoreData, by this I mean a relationship between attributes in sequential entities.
For example if I have an entity ‘Book’ with a to many relationship with another Entitiy ‘BookChapters’ with three attributes: ‘chapterNumber’, ‘pages’ and ‘runningTotal’.
Is there a way I can automagically calculate the running total of pages by adding all the pages previously but not after? A short cut would be to add the runningTotal of the previous chapter with the pages of the chapter but does it make sense to do it this way?
Should I do this in the class, if so how would I ensure it is saved?