Basically I have an entity called TimeLoc that has three attributes: time, latitude and longitude. And their types are Date, Double and Double respectively. I got stuck when
I guess you are sending parameters to the predicate in NSDate format :
let predicate = NSPredicate(format: "time>= \(startTime) AND time<= \(endTime)")
Here your startTime and endTime is of type NSDate . Try to convert it in String format and pass it to the predicate . It should work .
Reference : NSPredicate: filtering objects by day of NSDate property