I would like to be able fetch objects that have been sorted based on a dynamic value that would not be know until runtime. The value not know until runtime would be the current date.
For example if I have a database of all items I wish to or have purchase/d which includes attributes such as: -name (name of item) -cost (cost of item) -anticipatedDate (used for proposed purchase date of item) -actualDate (date item was purchased)
And I would like to fetch (using NSFetchedResultsController) the objects in three distinct groupings: A. items that have been purchased. B. items not purchased that were proposed to be purchased before today. C. items not purchased that are proposed to be purchased after today.
Because of the way NSFetchedResultsController works it would appear that I would need to create an attribute that would calculate on the fly (or immediately before the comparison) to indicate condition A, B or C noted above.
Not necessarily looking for code but for how conceptually I should go about doing the sort.