NSPredicate and NSString with whitespace gives runtime error

2013-04-22 Thread Koen van der Drift
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:

Re: NSPredicate and NSString with whitespace gives runtime error

2013-04-22 Thread Ben Gollmer
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

Re: NSPredicate and NSString with whitespace gives runtime error

2013-04-22 Thread Koen van der Drift
On Apr 22, 2013, at 12:15 PM, Ben Gollmer bgoll...@tcnetworks.com wrote: The problem may be the use of the word function in your predicate string. That's it! I changed the name of the attribute to objectFunction, and it works as expected. Thanks, - Koen.