• 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: Filter an array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filter an array


  • Subject: Re: Filter an array
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 28 Jul 2011 22:18:12 +0100

Further to earlier answers, bear in mind you've got no guarantee that file extensions are correct, or even exist. Plus of course, you might have both .jpg and .jpeg. You might well be better iterating through, finding the UTI of each file, and working from that.

On 28 Jul 2011, at 21:35, Chris Paveglio wrote:

> I have an array of file paths, and I need to filter them to return only files with extensions I have in another array. So any files that end with {.tif, .png, .eps} etc.
> I'm looking at using: - (NSArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate
> Is this the best option for this kind of filter? Is there any other way, aside from "doing it the long long way", i.e. enumerating over each's item's pathExtension in array1 through each file extension in array2?
> Thanks,
> Chris
> _______________________________________________
>
> 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

  • Follow-Ups:
    • Re: Filter an array
      • From: Wade Tregaskis <email@hidden>
References: 
 >Filter an array (From: Chris Paveglio <email@hidden>)

  • Prev by Date: Re: Filter an array
  • Next by Date: Return causes EXC_BAD_ACCESS
  • Previous by thread: Re: Filter an array
  • Next by thread: Re: Filter an array
  • Index(es):
    • Date
    • Thread