Re: NSNumber -> NSString
Re: NSNumber -> NSString
- Subject: Re: NSNumber -> NSString
- From: "Clark S. Cox III" <email@hidden>
- Date: Wed, 13 Mar 2002 16:34:54 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday, March 13, 2002, at 04:15 , Lukasz Kuczborski wrote:
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?
Off the top of my head:
NSNumber *num = ...
unsigned code = [ num unsignedIntValue ];
NSString *string = [ NSString stringWithCString: (char *)&code length:
sizeof unsigned ];
- --
Clark S. Cox, III
email@hidden
http://clarkcox.dyndns.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see
http://www.gnupg.org
iEYEARECAAYFAjyPxgUACgkQd6STocYT1xX0lgCgksFxKNDfnJHC5wDGJlmT+sEy
Wv8AnjXHWf1OaBEh1LXvzdqqpzCRiiAd
=H3n9
-----END PGP SIGNATURE-----
_______________________________________________
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.