On Apr 22, 2013, at 10:58 AM, Koen van der Drift <koenvanderdr...@gmail.com> 
wrote:

> Is there a way I can use an NSPredicate to search an NSString that contains 
> whitespaces (a sentence)?  If I use this:
> 
>       NSPredicate *functionPredicate = [NSPredicate predicateWithFormat: 
> @"function CONTAINS[cd] %@", searchString];
> 
> I keep getting a runtime error:
> 
>       'NSInvalidArgumentException', reason: 'Unable to parse the format 
> string "function CONTAINS[cd] %@"'
> 
> 
> My guess is this happens because the attribute contains whitespace, since I 
> have a bunch of similar NSPredicates that searches one-word attributes, and I 
> don't get the error.

The problem may be the use of the word "function" in your predicate string. See 
this SO question:

http://stackoverflow.com/questions/15801537/unable-to-parse-the-format-string-function-when-using-nspredicates-pr

-- 
Ben

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to