On May 26, 2010, at 7:39 AM, Graham Cox wrote:

> I have a property 'categories' of an object that returns a list (an array) of 
> objects, which in turn have a property 'name'.
> 
> Can I set up a NSPredicate that can match a string against any name in this 
> list? How?
> 
> In IB I set the left hand side to 'categories.name' but I get the error that 
> "Can't do a substring operation with something that isn't a string", which on 
> reflection makes sense.
> 
> I could add a property that does return a single string by combining all the 
> names into a comma delimited list, but I was hoping there might be a way to 
> define such a predicate without resorting to that (and also such an approach 
> loses the ability to correctly match 'begins with', 'ends with' and so on).

Not enough info: are you using Core Data, or a simple modeled relationship? I 
assume the issue is about traversing a relationship--otherwise the solution is 
trivial...

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to