Map your objects from MBurger objects
We are going to create an array of Home objects from the sections returned by the api.
The home objects will be like this:
Let’s add a mapping dictionary in Home like this, so that the section can map its elements to the Home object properties.
Now we have to create the array of homes from the MBSections
. To do so, let’s add the following in the success block:
Now in the homes array we will have Homes objects created from the sections.
We should do the same thing in the News and Gallery viewcontrollers, using different object models and a different mapping dictionary.
Last updated