• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about predicates and list properties.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about predicates and list properties.


  • Subject: Question about predicates and list properties.
  • From: Graham Cox <email@hidden>
  • Date: Wed, 26 May 2010 23:39:00 +1000

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).

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: Question about predicates and list properties.
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: subclass overwriting superclass ivar
  • Next by Date: Re: subclass overwriting superclass ivar
  • Previous by thread: Re: OutlineView Wierdness - 'item' not being stored.
  • Next by thread: Re: Question about predicates and list properties.
  • Index(es):
    • Date
    • Thread