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,
On Jul 29, 2011, at 11:09 AM, Wade Tregaskis wrote:
for (NSString *path in paths) {
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
NSString *uti = nil;
NSError *error = nil;
if ([url getResourceValue:uti forKey:NSURLTypeIdentifierKey
error:error]) {
Looks like the method -[NSArray pathsMatchingExtensions:] is case sensitive. I
don't have a problem declaring all the variations I need in lower or upper; but
I'll see if speed is an issue on a large number of files.
The docs don't state whether it's case sensitive or not.
Thanks for the
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
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
On Thu, Jul 28, 2011 at 1:35 PM, Chris Paveglio
chris_paveg...@yahoo.com 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
Oh, I don't know how I missed this, but there's a very convenient
-[NSArray pathsMatchingExtensions:] method already declared in
NSPathUtilities.h:
Oh, I don't know how I missed this, but there's a very convenient
-[NSArray pathsMatchingExtensions:] method already declared in
NSPathUtilities.h:
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
On Jul 28, 2011, at 1:35 PM, Chris Paveglio wrote:
I'm looking at using: - (NSArray *)filteredArrayUsingPredicate:(NSPredicate
*)predicate
I was going to suggest using a block to filter, but it seems that Foundation
collections still don’t implement the standard functional operators like
on 5/16/08 7:40 PM, [EMAIL PROTECTED] purportedly said:
I have created a multidimensional array by creating 3 NSArray's (call
them childArray1, childArray2, childArray3) and them adding them to
one NSArray (call it parentArray). I am using predicate to search out
the array which finds the
I have created a multidimensional array by creating 3 NSArray's (call
them childArray1, childArray2, childArray3) and them adding them to
one NSArray (call it parentArray). I am using predicate to search out
the array which finds the item I'm searching for. However, how I
return the name
12 matches
Mail list logo