Traditional Mac OS four character codes supported non-ASCII values, interpreted as MacRoman.
even the use of | instead of +
Note about String.data(using:):
I had a hard time understanding where this is coming from. This function is nowhere to be found in the Xcode documentation for String. It has a quick help, but that's it. Jumping to definition leads to a page with only imports. Jumping to definition of String leads to a very long file, where this function is missing.
Only googling for it, leads to NSString.data
So this function requires bridging String to NSString. Therefore it requires Foundation. Right?
Overall, I found Xcode documentation difficult to use, of rather little help for reference purposes, and very spotty.
of course, searching for "data" anywhere is not very specific and returns many false positives...
Or perhaps I missed something. Is there documentation on how to use Xcode documentation?
though I am not sure how it applies to a file format such as .MP4
That’s an interesting question. MPEG-4’s container format is a ‘child’ of QuickTime, and QuickTime definitely used MacRoman for this. I’m not sure whether they removed that dependency as part of the standardisation process. It’s possible that they didn’t address it at all, and just standardised on the UInt32 values. The only way to know for sure is to look at the MPEG-4 standard itself.
Note about String.data(using:):
I had a hard time understanding where this is coming from.
Indeed. The Quick Help usually has a link to the documentation but that’s not present in this case. I suspect this is because the symbol is implemented in Foundation’s Swift overlay. Regardless, the fact that Xcode won’t take you to the documentation is bugworthy IMO. Please file a bug about that (and post your bug number, just for the record).
… it requires Foundation. Right?
So this function requires bridging String to NSString.
If I’m right, and this is part of Foundation’s Swift overlay, the bridging situation is nuanced.
Personally, I don’t lose a lot of sleep worrying about this sort of bridging. If something is slow and I’ve profiled it and the profile shows that bridging is part of the problem, I look into it. Otherwise I just accept it as a part of life.
Share and Enjoy
Quinn “The Eskimo!” @ DTS @ Apple