Re: filtering an array of entities using NSPredicate
Re: filtering an array of entities using NSPredicate
- Subject: Re: filtering an array of entities using NSPredicate
- From: Koen van der Drift <email@hidden>
- Date: Mon, 15 Oct 2012 06:45:52 -0400
So I cannot directly filter an array of dictionaries using a predicate? That was the whole goal of my question, see my original post.
- Koen.
On Oct 15, 2012, at 6:33 AM, Willeke <email@hidden> wrote:
>
> Op 15 okt 2012, om 02:05 heeft Koen van der Drift het volgende geschreven:
>
>>
>> On Oct 14, 2012, at 7:56 PM, Willeke <email@hidden> wrote:
>>
>>> the predicate should be something like
>>> name IN {"Jones A.", "Williams S.", "Brown M.", "Tobias S."}
>>>
>>> what is persons in this statement?
>>> [fetchRequest setPredicate: [NSPredicate predicateWithFormat: @"name IN %@", persons]];
>>
>> 'persons' is an array of dictionaries, where one of the key-value pairs contains the name.
>>
>> - Koen.
>
> It should be an array of strings:
> [fetchRequest setPredicate: [NSPredicate predicateWithFormat: @"name IN %@", [persons valueForKey:@"name"]]];
>
> Willeke
> _______________________________________________
>
> 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
_______________________________________________
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