NSPredicate dont work with double values (%f)?

Viewed 7883

My managed object has 2 double fields: "latitude", "longitude". I need to fetch all objects, that has certain coordinates

This code not working, fetchedObjects count = 0

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"latitude == %f AND longitude == %f", coordinate.latitude, coordinate.longitude];

But this code work fine, fetchedObjects count = 3:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"latitude == 53.012667 AND longitude == 36.113000"];
4 Answers

it works fine with long float, %lf

Related