Quote:
Originally Posted by jollyrgr
I have a core data app the has an entity named "house" with float type attributes labeled "arv" and "offer".
I want to subtract "offer" from "arv", how do I do this? Can I do it in core data or can I do it in a class?
Thanks in advance and the best of the holidays to your families!
Roger
|
It depends on the details.
It sounds like you want to be able to calculate the value of offer-arv for every instance of your house entity.
In that case you should create a derived property of your house entity.
You typically create an object for your entity that is a subclass of NSManagedObject. You can add properties to your subclass (or a category of your NSManagedObject class) that let you fetch calculated values. In your case, you could add a new readonly property calculatedValue who's getter would return offer-arv.