title: Structs to NSData to Structs?
body: <p>I have the following struct:</p>
  
  <pre><code>typedef enum
  {
      kPacketTypeJoin = 1,
      kPacketTypeServerAcceptedJoin,
      kPacketTypeSelectedNumber,
  } PacketTypes;    
  typedef struct
  {
      PacketTypes type;
      NSString *name;
  } PacketJoin;
  </code></pre>
  
  <p>how would I convert a PacketJoin into NSData and back to PacketJoin again? </p>