Re: alternate file extension
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