title: Writing Objective C objects into firebase
body: <p>I've been using firebase successfully to read and write data for an iOS app. Now I'm starting to need to store and retrieve more complex objects. I want to make sure I'm proceeding in the correct manner.</p>
  
  <p>I've got a class such as,</p>
  
  <pre><code>@interface MyClass : NSObject
  
  @property (strong, nonatomic) NSString *name;
  @property (strong, nonatomic) NSString *id;
  
  @end
  </code></pre>
  
  <p>When I write this class into firebase,</p>
  
  <pre><code>MyClass *myClass1 = [[MyClass alloc] init];
  myClass1.name = @"Bakery";
  myClass1.id = @"1";
  
  [firebase setValue:myClass1];
  </code></pre>
  
  <p>An exception is thrown,</p>
  
  <p>'Unknown class in payload: MyClass; only NSDictionary and NSArray supported.'</p>
  
  <p>I see in the iOS firebase docs that NSNumber, NSString, NSArray and NSDictionary are listed as the types the setValue: can handle.</p>
  
  <p>Does this mean I can't use setValue:on my classes? Do I need to unwrap my objects into instances of the NSNumber, NSString, NSArray or NSDictionary objects to store data? I was thinking that the iOS firebase implementation would be able to serialize simple objects to save to firebase.</p>