How to specify range with NSPredicate in Objective C
问题 I want to query sqllite table by specifying a range. So it's like give me all records whose id column between 3000 and 3010. I tried what Apple recommends, but it didn't work. Here is what I tried and failed. NSPredicate *betweenPredicate = [NSPredicate predicateWithFormat: @"attributeName BETWEEN %@", @[@1, @10]]; I have 2 strings called start and end. I updated Apple's example as following. NSPredicate *betweenPredicate = [NSPredicate predicateWithFormat: @"%@ BETWEEN %@", columnName, @