• 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: Predicate expressions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Predicate expressions


  • Subject: Re: Predicate expressions
  • From: "Hamish Allan" <email@hidden>
  • Date: Sun, 1 Jun 2008 20:40:17 +0100

On Sun, Jun 1, 2008 at 8:26 PM, Kyle Sluder
<email@hidden> wrote:

> On Sat, May 31, 2008 at 4:57 PM, Fabian <email@hidden> wrote:
>> NSArray *arrayB = [self getObjects] ;
>>
>> NSArray *titles = [arrayB arrayByApplyingSelector:@selector(title)];
>> NSArray *subtitles = [arrayB arrayByApplyingSelector:@selector(subtitle)];
>>
>> NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(title IN
>> %@) AND (subtitle IN %@)", titles, subtitles];
>> NSArray *result = [arrayA filteredArrayUsingPredicate:predicate];
>
> I am *really* confused as to what you're trying to do here.  You have
> asked the NSArray for all objects from array B whose title is in the
> collection of all titles of objects in array B and whose subtitle is
> in the collection of all subtitles of objects in array B.  Basically,
> you have said "give me all the objects."

He's asking for all objects of array *A* whose titles and subtitles
are in the collections from array B (see the target of
'filteredArrayUsingPredicate: above).

Hamish
_______________________________________________

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

References: 
 >Re: Predicate expressions (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: Predicate expressions
  • Next by Date: Re: KVO: I get called on change, but then can't get the object
  • Previous by thread: Re: Predicate expressions
  • Next by thread: Re: Predicate expressions
  • Index(es):
    • Date
    • Thread