FROM : Kyle Sluder
DATE : Sun Jun 01 21:26:05 2008
On Sat, May 31, 2008 at 4:57 PM, Fabian <<email_removed>> 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."
Given you description of what you want to do, though, it sounds like
you're trying to find duplicates, as far as the title and subtitle are
concerned?
--Kyle Sluder
DATE : Sun Jun 01 21:26:05 2008
On Sat, May 31, 2008 at 4:57 PM, Fabian <<email_removed>> 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."
Given you description of what you want to do, though, it sounds like
you're trying to find duplicates, as far as the title and subtitle are
concerned?
--Kyle Sluder
| Related mails | Author | Date |
|---|---|---|
| Fabian | May 31, 22:57 | |
| Kyle Sluder | Jun 1, 21:26 | |
| Hamish Allan | Jun 1, 21:35 | |
| Hamish Allan | Jun 1, 21:40 |






Cocoa mail archive

