Re: NSNumber -> NSString
Re: NSNumber -> NSString
- Subject: Re: NSNumber -> NSString
- From: email@hidden
- Date: Fri, 15 Mar 2002 17:46:51 -0800
Anyone know how to convert NSNumber to NSString? (what method?)
I want to get file's creator and code...but NSFileHFSCreatorCode and
NSFileHFSTypeCode gives me numbers like: "1276423498", and i want to
get it
in String like: "hlmg" - creator, "ddsk" - code.
Any ideas?
From the Foundation functions reference:
HFS File Types
NSFileTypeForHFSTypeCode
Returns a string encoding a file type code.
NSString *NSFileTypeForHFSTypeCode(OSType hfsFileTypeCode)
Discussion
Given an HFS file type code, this function returns a string that encodes
the file type. The string will have been autoreleased.
...looks promising. :)
Actually, if I understand the recent post by Ali properly, this
function should not be used for this purpose. As I understood his post,
the fact that the "NSFileType" string returned happens to have a
human-readable representation of the OSType as a string should be
considered an implementation detail. This function (and the
corresponding one that gives an OSType given an NSFileType) should be
used solely for converting between the OSType and NSFileType
representations of the type. For a human-readable representation of the
type as a string, one should apparently roll one's own. (And code to do
that was, you guessed it, recently posted to the archives :->).
Ben Haller
Stick Software
_______________________________________________
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.