NSPredicate and NSString with whitespace gives runtime error
NSPredicate and NSString with whitespace gives runtime error
- Subject: NSPredicate and NSString with whitespace gives runtime error
- From: Koen van der Drift <email@hidden>
- Date: Mon, 22 Apr 2013 10:58:17 -0400
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.
Thanks,
- Koen.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden