Re: -[NSPredicate evaluateWithObject:] and NSArray
Re: -[NSPredicate evaluateWithObject:] and NSArray
- Subject: Re: -[NSPredicate evaluateWithObject:] and NSArray
- From: Keary Suska <email@hidden>
- Date: Thu, 14 Jun 2007 08:52:51 -0600
- Thread-topic: -[NSPredicate evaluateWithObject:] and NSArray
on 6/13/07 6:06 PM, email@hidden purportedly said:
> I have a KVC-compliant object. The value for key
> kMDItemContactKeywords is a multi-value, so -valueForKey: returns an
> array of objects. I have a predicate that is normally used for
> Spotlight searching, and I want to see if individual objects match
> the predicate, but -evaluateWithObject: seems to raise exceptions
> when trying to parse an NSArray, whereas NSMetadataQuery handles the
> situation correctly.
Are you passing your NSArray as the object parameter to
-evaluateWithObject:? If so, considering that the method returns a *single*
boolean value, how could it possibly work with a collection object?
> Is there any sort of workaround to this problem, and if so, then what
> do I do to get multi-values to work correctly with -[NSPredicate
> evaluateWithObject:]?
What would lead you to believe that NSMetadataQuery and NSPredicate would
behave similarly, or even analogously? Note the keyword differences "query"
vs "predicate". Therein lies your answer.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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