Skip to content
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 commented Apr 26, 2013



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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.