X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/b9680b3436f56a369a00e35ff7b8d1d87df8176f..6262c31ef1f3b4c4cec3e909f0ecc189eb242ab2:/ITCategory-NSString.m diff --git a/ITCategory-NSString.m b/ITCategory-NSString.m index fd036ae..e08e046 100644 --- a/ITCategory-NSString.m +++ b/ITCategory-NSString.m @@ -7,18 +7,22 @@ } - (id)initWithFourCharCode:(unsigned long)fourCharCode { - return [self initWithFormat:@"%.4s", &fourCharCode]; + return UTCreateStringForOSType(fourCharCode); + //return [self initWithFormat:@"%.4s", &fourCharCode]; } - (unsigned long)fourCharCode { - const unsigned char *c_s = [self UTF8String]; + return UTGetOSTypeFromString((CFStringRef)self); + + //Die nasty bitshifting + /*const unsigned char *c_s = [self UTF8String]; unsigned long tmp = *c_s++; tmp <<= 8; tmp |= *c_s++; tmp <<= 8; tmp |= *c_s++; tmp <<= 8; - return tmp |= *c_s++; + return tmp |= *c_s++;*/ } @end \ No newline at end of file