I have an NSOrderedSet
of a custom class CDRoute
which wraps and provides dynamic member lookup to a custom enumeration type called Route
. The Route
type has a property called precedence
(Int16
type) and I would like to have a derived core data attribute where I can access the highest precedence value in the NSOrderedSet
. This is relatively straightforward using Swift Computed Properties but I would like to incorporate this using core data since I've been having difficulty with changes being noticed. Due to the blatant lack of documentation surrounding how to construct a format string/woefully out of date documentation that describes how to do it in code but not how to format it in the Core Data model editor, I'm having a really difficult time with this. Is there any way to do something equivalent to the Swift map function ie
stops.routesServed.map({ $0.precedence }).@max
where stops.routesServed
is the NSOrderedSet
?