title: Serialize a custom object as a value using NSJSONSerialization
body: <p>So my JSON request should look something like:</p>
  
  <pre><code>{ 
     "MyDictionary" : ["some values"], 
     "RegularValue" : "regularValue",
  }
  </code></pre>
  
  <p>So what I currently have done is:</p>
  
  <pre><code>NSDictionary *myDict = @{@"Blah" : @"1", @"Yadayada" : @"2"}; 
  NSDictionary *jsonDict = @{"MyDictionary" : myDict, "RegularValue" : "someValue"};
  NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:kNilOptions error:&amp;error];
  </code></pre>
  
  <p>So this works fine.  The problem I have is, instead of manually creating MyDictionary, what I want to do is use a custom sublcass of NSObject and serialize that to JSON.  I basically have to manually create the NSDictionary for the properties of my custom NSObject and put that in the NSJSONSerialization method.  But I was wondering if there was a better way to do this?  Thanks.</p>