我正在尝试构建查询字符串或谓词,但我不断收到此错误,
基本上我无法理解的是这很好用:
NSPredicate *pred = [NSPredicate predicateWithFormat:@"(name contains[cd] 'o')"];
但是这个:
NSString *predString = @"(name contains[cd] 'o')";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"%@", predString];
抛出这个:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "%@"'