I’m trying to build a query string or predicate but I keep getting this error,
Basically what I can’t understand is that this works fine:
NSPredicate *pred = [NSPredicate predicateWithFormat:@"(name contains[cd] 'o')"];
But this:
NSString *predString = @"(name contains[cd] 'o')";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"%@", predString];
throws this:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "%@"'
%@is not a predicate format, it’s a string format.