Create a gist now

Instantly share code, notes, and snippets.

Decode OSStatus error codes into strings.
NSString *NSStringFromOSStatus(OSStatus errCode)
{
if (errCode == noErr)
return @"noErr";
char message[5] = {0};
*(UInt32*) message = CFSwapInt32HostToBig(errCode);
return [NSString stringWithCString:message encoding:NSASCIIStringEncoding];
}
@revolc
revolc commented Apr 26, 2013

gr8t!

@ShonFrazier

(NSString *) CreateTypeStringWithOSType(OSType inType); // ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment