re: NSPredicate/NSExpression - can they solve this Core Data problem?
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