title: NSInteger to byte array in reverse order
body: <p>I've been banging my head for the last couple of hours with what seemed to be a very easy task.</p>
  
  <p>My app is communicating with a server over tcpip.  The protocol requires that the first 4 bytes of each request be the length of the stream, in reverse order.  For example, if the length if 13, I need to supply (decimal) {0,0,0,13}; if it's 300, I need to supply {0,0,44,256}.  Then, the actual data follows.</p>
  
  <p>Apparently this is something very straightforward to do in Java, and also in VB (e.g. BitConverter.GetBytes(sendString.Length).Reverse().ToArray()).  But in obj-c I just couldn't make it work, I've tried all sorts of conversions between NSString/NSData/NSArray, with no luck.</p>
  
  <p>Thanks in advance!</p>