title: create data model for JSON - IOS/Objective-C
body: <p>I'm developing an IOS application in Objective C, in which i'l call a URL to retrieve an array JSON objects (restaurants). I want to parse them onto a objective-C <strong>Model</strong>. Using them to populate on to a UICollectionView that i have already designed. My task requires me to design this model to store the Json objects and then use them to populate onto UICollectionView. I don't know how to achieve this in Objective-C, please help me on this. The JSON retrieved is as follows.</p>
  
  <pre><code>"restaurants" : [
  {
      "name": "Burger Bar",
      "backgroundImageURL": "http://somthing.com/Images/1.png",
      "category" : "Burgers",
          "contact": {
              "phone": "1231231231",
              "formattedPhone": "(123) 123-1231",
              "twitter": "1twitter"
          },
          "location": {
              "address": "5100 Belt Line Road, STE 502",
              "crossStreet": "Dallas North Tollway",
              "lat": 32.950787,
              "lng": -96.821118,
              "postalCode": "75254",
              "cc": "US",
              "city": "Addison",
              "state": "TX",
              "country": "United States",
              "formattedAddress": [
                  "5100 Belt Line Road, STE 502 (Dallas North Tollway)",
                  "Addison, TX 75254",
                  "United States"
              ]
          }
  },
  {
      "name": "seafood Kitchen",
      "backgroundImageURL": "http://somthing.com/Images/2.png",
      "category": "Seafood",
          "contact": {
              "phone": "3213213213",
              "formattedPhone": "(321) 321-3213",
              "twitter": "2twitter"
          },
          "location": {
              "address": "18349 Dallas Pkwy",
              "crossStreet": "at Frankford Rd.",
              "lat": 32.99908456526653,
              "lng": -96.83018780592823,
              "postalCode": "33331",
              "cc": "US",
              "city": "Dallas",
              "state": "TX",
              "country": "United States",
              "formattedAddress": [
                  "18349 Dallas Pkwy (at Frankford Rd.)",
                  "Dallas, TX 75287",
                  "United States"
              ]
          }
  }
  </code></pre>
  
  <p>]</p>
  
  <p>Below code shows how to call URL and retrieve and print the <em>parse</em> JSON objects.</p>
  
  <pre><code>NSString *urlString = @"http://somthing.com/Images/collection.json";
  NSURL *url = [NSURL URLWithString:urlString];
  NSURLRequest *request = [NSURLRequest requestWithURL:url];
  [NSURLConnection sendAsynchronousRequest:request
                                     queue:[NSOperationQueue mainQueue]
                         completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
                             if (!error) {
                                 NSError* parseError;
                                 id parse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&amp;parseError];  
                                 NSLog(@"%@", parse);
                             }
                         }];
  </code></pre>
  
  <p>How to create the <strong>restaurant data model</strong>. Or is there any other way to go about this? </p>