• 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
re: NSPredicate/NSExpression - can they solve this Core Data problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: NSPredicate/NSExpression - can they solve this Core Data problem?


  • Subject: re: NSPredicate/NSExpression - can they solve this Core Data problem?
  • From: Ben Trumbull <email@hidden>
  • Date: Fri, 2 Apr 2010 12:45:42 -0700

> Objects:
>  - NSManagedObject *item - some managaged object
>  - NSArray *attributes - an array of the item's attributes
>
> Desired Result:
>  - a possibly smaller array of attribites where [item valueForKey:<an
> attribute>] != nil.
>
> In code, I can simply iterate over the keys, perform the valueForKey,
> and skip nil values. I played around with expressions and predicates to
> solve this, to no avail.

Having the array of attributes unrolled separately is a little odd.  Do you mean you have an array of attribute names from, say the entity, and you want to ask a MO for all its non-nil attribute values and get back an array of matching attribute names for those non-nil values?

- Ben



_______________________________________________

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: NSPredicate/NSExpression - can they solve this Core Data problem?
      • From: David Hoerl <email@hidden>
  • Prev by Date: CIFilter - output image format
  • Next by Date: MutableArray losing contents
  • Previous by thread: CIFilter - output image format
  • Next by thread: Re: NSPredicate/NSExpression - can they solve this Core Data problem?
  • Index(es):
    • Date
    • Thread