• 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
NSWorkspace getInfoForFile:application:type:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWorkspace getInfoForFile:application:type:


  • Subject: NSWorkspace getInfoForFile:application:type:
  • From: "Jonathan D. Nolen" <email@hidden>
  • Date: Wed, 8 Aug 2001 11:24:56 -0700

I've been having some trouble with NSWorkspace's getInfoForFile:application:type: method. It's supposed to give you two strings: one for the application that will open the file, and another to tell you what type of file it is (Directory, Application, Filesystem, etc).

In the source code below, the appName string comes back just fine, but the fileType is always empty. Can anyone spot what I doing wrong?

- (BOOL) isItemADriveAtPath:(NSString *) thePath {

NSString *appName;
NSString *fileType;

[[NSWorkspace sharedWorkspace] getInfoForFile: thePath
application: &appName
type: &fileType ];

NSLog(@"appName = %@\n", appName);
NSLog(@"fileType = %@\n", fileType);

if( [ fileType isEqualToString:@"NSFilesystemFileType" ] ) {
return YES;
}
return NO;

}

I found a Usenet post from someone else who ran into the same problem, but no one ever answered him. (http://groups.google.com/groups?q=NSWorkspace&hl=en&safe=off&rnum=3&selm=9e9duf$adu$email@hidden)

If this is a bug, can anyone suggest a workaround?

Any help is much appreciated.

Thanks,
Jonathan

--
Jonathan D. Nolen
mail: email@hidden


  • Prev by Date: Re: Cocoa downgrade from openstep?
  • Next by Date: Re: Switching content of NSBox causes strange(?) error msg
  • Previous by thread: Re: Cocoa downgrade from openstep?
  • Next by thread: NSTextField update and multithreaded app
  • Index(es):
    • Date
    • Thread