Re: Does NSData rearrange the order of bits?

2009-12-02 Thread Bryan Henry
Your log messages show that the NSData's bytes are stored completely correctly, you're just interpreting it incorrectly. NSData's description method will list the bytes in order, so you see 510600f0. On the other hand, you used the %x format specifier to create your string, which will print

Re: Does NSData rearrange the order of bits?

2009-12-01 Thread Jeremy Pereira
On 30 Nov 2009, at 20:32, Brad Gibbs wrote: Another list member mailed me an explanation offline, causing me to look for and find the real problem preventing my code from running. Any chance of posting the off list response back to the list? It would improve the usefulness of the list

Does NSData rearrange the order of bits?

2009-11-30 Thread Brad Gibbs
Hi, I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object with [NSData dataWithBytes: length], the order of the

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 11:27 AM, Brad Gibbs wrote: I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object with

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Brad Gibbs
I guess it is. I had another issue that was preventing the code from working properly. Another list member mailed me an explanation offline, causing me to look for and find the real problem preventing my code from running. Thanks for the response. On Nov 30, 2009, at 12:22 PM, Jens Alfke

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Peter Duniho
On Nov 30, 2009, at 11:27 AM, Brad Gibbs wrote: Hi, I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object