How to query R-Tree Core Data index

Using the predicate from the WWDC 2018 slides,

NSCompoundPredicate(type: NSCompoundPredicate.LogicalType.and, subpredicates: [ NSPredicate(format: "indexed:by:(xCoord, \"byLocation\") between { %@, %@ }", argumentArray: [ 0, 30 ]), NSPredicate(format: "indexed:by:(yCoord, \"byLocation\") between { %@, %@ }", argumentArray: [ 0, 44 ])])

on a model with an R-Tree index named "byLocation" on the properties xCoord & yCoord (float)

gives me a strange error message:

[<NSKeyPathExpression 0x60000164fcc0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name.

Somebody seen this before?

I was facing the same crash, I solved it making the fields non optionals... (xCoord and yCoord in this case)

How to query R-Tree Core Data index
 
 
Q