0

I have value:

private var journeysArray : [JourneyInformation]!

In viewWillAppear I load data from Core Data:

        let moc = DataController().managedObjectContext
        let reqest = NSFetchRequest(entityName: "JourneyInformation")
do {
        journeysArray = try moc.executeFetchRequest(reqest) as! [JourneyInformation]
        journeysTableView.reloadData()
    } catch {
        fatalError("Core data error \(error)")
    }

In first reload data all works well, and I can get all needed information, but after second reload:

    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

        tableView.reloadData()

Attributes in the JourneyInformation object are nil. journeysArray show that it contain 4 objects as before. How get objects and works with them without losses?

Cœur
  • 37,241
  • 25
  • 195
  • 267
biloshkurskyi.ss
  • 1,358
  • 3
  • 15
  • 34

0 Answers0