Re: Need help with predicate format

2008-07-28 Thread Graham Cox
On 28 Jul 2008, at 1:52 pm, Omar Qazi wrote: To be honest, I don't know if this will work, since I don't know if containsObject is checking if the argument is a pointer to an object in the array, or if it is equal to the object, but it's better than nothing, I guess. From the docs:

Re: Need help with predicate format

2008-07-28 Thread Fabian
Thanks. Maybe I should have made myself a little more clear. I don't want to iterate over the array, but filter the array using a NSPredicate. I'm looking at the Predicate Programming Guide, which only gives basic guidance, and the docs for NSExpression. It has several class methods that sound

Re: Need help with predicate format

2008-07-28 Thread Conrad Taylor
Hi, I would recommend taking a look at the following document. http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/predicates.html Good luck, -Conrad On Mon, Jul 28, 2008 at 1:02 AM, Fabian [EMAIL PROTECTED] wrote: Thanks. Maybe I should have made myself a little more clear.

Re: Need help with predicate format

2008-07-28 Thread Fabian
Thanks. As I said, I already read that but it doesn't give any examples on how to format subqueries. Anyway, I ended up adding a helper method to my subclass after all. It returns a single array of keywords, which I can examine using a predicate with format (ANY keywords contains[c] %@,

Need help with predicate format

2008-07-27 Thread Fabian
Hello, I'm trying to understand how to use subquery expressions, but I just don't... :-) I have an array of MyCustomClass objects. MyCustomClass has a function that returns an array of dictionaries. I want to query all keys in each dictionary for a given string, i. e. something like (ANY

Re: Need help with predicate format

2008-07-27 Thread Omar Qazi
On Jul 27, 2008, at 1:37 PM, Fabian wrote: I want to query all keys in each dictionary for a given string, i. e. something like (ANY SELF.function.collection.keys.value contains %@, searchString). What is the most efficient way to do this? Well, NSArray has a method called containsObject: