Adding location data for the table view
At this point, you have created and configured the LocationViewController
class. An instance of this class will act as the data source for the table view in the Locations screen. The views and the controller for this screen have been set up, so now you'll create model objects to make the table view display a list of actual locations. Just like you did in the previous chapter, you'll use a .plist
file that contains location data, but instead of using an existing .plist
file, you'll create one from scratch and add location data to it. Follow these steps:
- Right-click the
Model
folder in theLocation
folder and choose New File. - iOS should already be selected. Type
proper
in the filter field; Property List will appear in the window. Choose Property List and then click Next. - Name the file
Locations
, and click Create.
The Locations.plist
file has been added to the project. In the previous chapter, you've seen...