I am trying to query a table using NSPredicate. Here is essentially what I'm doing:
NSNumber *value = [NSNumber numberWithInteger: 2];
NSString *columnName = @"something_id";
NSLog(@"%@ == %@", columnName, value);
NSPredicate *refQuery = [NSPredicate predicateWithFormat: @"%@ == %@", columnName, value];
NSLog prints out what I expect ("something_id == 2"), but the predicate doesn't work. However, the predicate DOES work if I change it to:
NSPredicate *refQuery = [NSPredicate predicateWithFormat: @"something_id == %@", value];
So why won't this work and how can I fix it?