title: CoreData, displaying saved journeys in a tableview
body: <p>I am trying to display a list of all journeys recorded in a fitness-style app in a table view to show the distance (boolean) and date (timestamp) of each journey.</p>
  
  <p>At the moment I have just created a variable to contain the Journeys from the core data file. When I print out the journeysArray, it shows 0 in the console even though there are some recorded journeys.</p>
  
  <pre><code>import UIKit
  import CoreData
  
  class SavedJourneysViewController: UITableViewController {
  
      var journeyArray: [Journey] = []
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          print(journeyArray.count)
          return journeyArray.count
  
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "JourneyItem", for: indexPath)
          return cell
  
      }
  </code></pre>