【发布时间】:2010-10-15 12:07:59
【问题描述】:
我正在尝试使用 NSPredicate 查询表。这基本上就是我正在做的事情:
NSNumber *value = [NSNumber numberWithInteger: 2];
NSString *columnName = @"something_id";
NSLog(@"%@ == %@", columnName, value);
NSPredicate *refQuery = [NSPredicate predicateWithFormat: @"%@ == %@", columnName, value];
NSLog 打印出我所期望的(“something_id == 2”),但谓词不起作用。 但是,如果我将谓词更改为:
NSPredicate *refQuery = [NSPredicate predicateWithFormat: @"something_id == %@", value];
那么为什么这不起作用,我该如何解决呢?
【问题讨论】:
-
这很奇怪......我也遇到过......
标签: objective-c core-data