X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/034559d9a2f0b8e607b0365152b9c73732f00e6e..0768987a841ee4bc1839b2e6843e1a87c98054ad:/ITCarbonSupport.m diff --git a/ITCarbonSupport.m b/ITCarbonSupport.m index 31d25cd..23b6f69 100644 --- a/ITCarbonSupport.m +++ b/ITCarbonSupport.m @@ -1,16 +1,10 @@ #import "ITCarbonSupport.h" +#import "ITCategory-NSString.h" NSString *NSStringFromFourCharCode(unsigned long code) { - return [NSString stringWithFormat:@"%.4s", &code]; + return [NSString stringWithFourCharCode:code]; } unsigned long FourCharCodeFromNSString(NSString *string) { - const unsigned char *c_s = [string UTF8String]; - unsigned long tmp = *c_s++; - tmp <<= 8; - tmp |= *c_s++; - tmp <<= 8; - tmp |= *c_s++; - tmp <<= 8; - return tmp |= *c_s++; + return [string fourCharCode]; } \ No newline at end of file