On Oct 22, 2007, at 12:54 PM, Alastair Houghton wrote:
You're probably over-thinking it. That's the usual reason for
problems like this.
=)
It doesn't make sense for an eight-bit value to be Big Endian (or
Little Endian).
Sorry, yes, I meant the overall file requires Big Endian values (.mov
and .m4a)
Anyway, I'm unclear what you need here (and I think the reason is
that *you're* unclear what it is that you need). Do you want a
binary value? Or an ASCII string consisting of two hexadecimal
digits?
If you need binary, e.g. in an NSData, all you need do is:
Ok, my problem here was something simple... I wasn't casting the
[NSString length] to a int8_t. The following worked...
So, I need to convert an NSString value of something like "http:///
www.apple.com", to a straight c-string and write that out. I've tried
a lot of different ways, but I keep ending up with lots of binary
0's. I think there is something fundamental about bytes/characters/
etc. that I don't get.
Well, it depends exactly what it is that you want to learn. A good
place to start, for lower-level things like bytes, would be
learning plain, vanilla C (not C++, Cocoa, C#, Java or anything
like that, as tutorials in those languages tend either to assume
that you know C, or try to skirt around the issue entirely). It
sounds like you might also want to take a good look at the whole
area of character encoding, so that you understand why the results
you show above are as they are... you might start by taking a look
at ASCII: <http://en.wikipedia.org/wiki/ASCII>