• 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: alternate file extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alternate file extension


  • Subject: Re: alternate file extension
  • From: Scott Anguish <email@hidden>
  • Date: Mon, 19 Feb 2007 20:57:38 -0500


On Feb 19, 2007, at 5:39 PM, Jacob Eggers wrote:

Okay, so this is a simple question, I want to get an NSArray with all of the
images in a particular directory.


I could do something like this:
[bundle pathsForResourcesOfType: @"jpg" inDirectory: dir];

But, then I'm missing extensions of gif, tiff.. not to mention jpeg, JPG
Jpeg....


Is there an easy way to handle this, or should I just write a custom
NSBundle class with the many appropriate checks?

Use the NSImage class method imageFileTypes to get an array of file types that are supported for loading


iterate over that list calling pathsForResourcesOfType:inDirectory: for each one.

you'll only get the types you can read, but you'll also be able to load types that use services for conversion.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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: alternate file extension
      • From: "Jacob Eggers" <email@hidden>
References: 
 >alternate file extension (From: "Jacob Eggers" <email@hidden>)

  • Prev by Date: Re: alternate file extension
  • Next by Date: Re: Automatic fill in of logins in WebViews?
  • Previous by thread: Re: alternate file extension
  • Next by thread: Re: alternate file extension
  • Index(es):
    • Date
    • Thread