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: Willeke <email@hidden>
- Date: Mon, 15 Oct 2012 12:33:01 +0200
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