What type of data is this?
I saw something like this in the class header:
enum {
kAudioSessionProperty_PreferredHardwareSampleRate = 'hwsr', // Float64
kAudioSessionProperty_PreferredHardwareIOBufferDuration = 'iobd' // Float32
};
Now I wonder what datatype such kAudioSessionProperty_PreferredHardwareSampleRate is actually?
I mean it looks like plain old C, but in Objective-C I would write @ "hwsr" if I wanted to make it a string.
I want to pass such a "constant" or "enumerated thing" as an argument to a method.
a source to share
This is converted to a UInt32 enumeration value using the ASCII value of each of the entries. This style has been around for a long time in Mac OS headers.
'hwsr' has the same meaning as if you had written 0x68777372, but much more reader friendly. If you were using the @ "hwsr" style, you would instead need more than 4 bytes to represent the same.
The advantage of using this style is that you can really quickly identify the content of the raw data stream if you can see its ASCII values.
a source to share