• 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: Sean McBride <email@hidden>
  • Date: Fri, 05 Aug 2011 11:16:52 -0400
  • Organization: Rogue Research Inc.

On Fri, 29 Jul 2011 09:09:43 -0700, Wade Tregaskis said:

>> 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.
>
>Oooh, that's kind of embarrassing. :)  Yes, that's a very good point,
>that we all should have realised before worrying about the details of
>file extension comparison.  So I'll retract my prior recommendations and
>instead suggest using something like:

Indeed file extensions are lame and fragile, and may not even be present.

But UTIs are not perfect either.  For one, the OS derives them primarily from the file extension anyway (though also from HFS type), which means they fail horribly for common extensions used by multiple formats.  ex: ".img" is used by many formats (sadly).  Ask the OS what the UTI of a .img file is, and you'll get different answers on different computers, depending which apps are installed and declare a UTI for that extension.

So the OP may be better dealing with extensions directly, depending.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Prev by Date: cleanly support drag-to-trash for uninstall?
  • Next by Date: Re: Cocoa-dev Digest, Vol 8, Issue 597
  • Previous by thread: Re: cleanly support drag-to-trash for uninstall?
  • Next by thread: Re: [Q] including omp.h?
  • Index(es):
    • Date
    • Thread