Wanting to minimize the amount of coding I need (since this is the diagnostic / debugging code that I want to keep simple), I chose the C function, which returns an NSString:
NSString* statToString(UInt32 source) { char buf[4]; char* sourceView = (char*) &source; buf[0] = sourceView[3]; buf[1] = sourceView[2]; buf[2] = sourceView[1]; buf[3] = sourceView[0]; return [[[NSString alloc] initWithBytes:buf length:4 encoding:NSUTF8StringEncoding] autorelease]; }
This allows you to use the function directly in the NSLog parameter list, for example, without the need to declare any tempo.
Perhaps he can tighten it using one of the tampon options, but this level of optimization is not required.
source share