Re: cocoa-dev digest, Vol 1 #376 - 15 msgs
Re: cocoa-dev digest, Vol 1 #376 - 15 msgs
- Subject: Re: cocoa-dev digest, Vol 1 #376 - 15 msgs
- From: David Adamson <email@hidden>
- Date: Thu, 9 Aug 2001 09:51:02 -0400
if( [ fileType isEqualToString:@"NSFilesystemFileType" ] )
{
return YES;
}
return NO;
I don't know why filetype is empty, but I've seen it happen.
Perhaps some things just don't have file types? Folders and Classic
apps, for two examples, give you nothing, but Cocoa apps and RTF
documents do.
But there's an error in the code quoted above that I ran into only
yesterday, a simple not-paying-attention mistake.
NSFilesystemFileType is a constant, the name of the NSString
identifiying filesystem files and not the NSString itself. The
actual NSString for NSApplicationFileType, for example, is @"app".
So you'd want
if( [ fileType isEqualToString:NSFilesystemFileType ] )
{
return YES;
}
return NO;
instead.
Cheers,
-David.