NSHFSTypeCodeFromFileType() == 0?
NSHFSTypeCodeFromFileType() == 0?
- Subject: NSHFSTypeCodeFromFileType() == 0?
- From: Randall Meadows <email@hidden>
- Date: Tue, 24 Feb 2004 11:36:24 -0500
OK, so now that I've been enlightened as to how HFS file types are
handled by Cocoa, I've tried to do The Right Thing and be consistent
in how I'm using them, by incorporating the functions in
NSHFSFileTypes.h.
Problem: "OSType NSHFSTypeCodeFromFileType(NSString
*fileTypeString);" always returns 0 (zero). I've tried feeding it
several different values in several different way, and always get the
same result: 0 (zero).
OSType creator = NSHFSTypeCodeFromFileType([NSString
stringWithString:@"asdf"]);
OSType creator = NSHFSTypeCodeFromFileType(@"asdf");
NSString *type = @"asdf";
OSType creator = NSHFSTypeCodeFromFileType(type);
In all cases, creator = 0 (zero).
Code that I had working yesterday broke when I changed
NSString *type = NSFileTypeForHFSTypeCode('asdf');
to
NSString * type =
NSFileTypeForHFSTypeCode(NSHFSTypeCodeFromFileType(fileType));
where "fileType" was declared as
NSString *fileType = @"asdf";
during some code cleanup. This also fails in other places where I
have something like:
FourCharCode appSig = NSHFSTypeCodeFromFileType(toolSig);
Bug? Or am I a bonehead?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.