         saveObject()
     }
     @IBAction func clickFetchBtn(_ sender: UIButton) {
-//        configureFetchedResultsController()
+        configureFetchedResultsController()
     }
     @IBAction func clickLogBtn(_ sender: UIButton) {
         for object in (fetchedResultsController?.fetchedObjects)! {
-            let task = object as! Task
-            print("\(String(describing: task.taskName)), \(String(describing: task.taskType))")
+            let task = object as! TaskType
+            print("\(String(describing: task.name)), \(String(describing: task.addDate))")
         }
 //        let task = fetchedResultsController?.object(at: IndexPath(item: 0, section: 0)) as! Task
 //        print("\(task.taskName)")

import UIKit
import CoreData

class ViewController: UIViewController, CoreDataManagerViewController {
    
    var coreDataManager: CoreDataManager?
    var modelObjectType: ModelObjectType?

            }
        }
    }
    
    // NSFetchedResultsController
    func configureFetchedResultsController() {
        let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "TaskType")
        let nameSortDescriptor = NSSortDescriptor(key: "addDate", ascending: true)
        
        fetchRequest.sortDescriptors = [nameSortDescriptor]
//        fetchRequest.predicate = NSPredicate.init(format: "car == %@", TaskType as! CVarArg)
        
        if let managedObjectContext = coreDataManager?.mainThreadManagedObjectContext {
            fetchedResultsController = NSFetchedResultsController(
                fetchRequest: fetchRequest,
                managedObjectContext: managedObjectContext,
                sectionNameKeyPath: nil,
                cacheName: nil)
        }
        
        fetchedResultsController?.delegate = self
        
        do {
            try fetchedResultsController?.performFetch()
        }
        catch let error as NSError {
            fatalError("NotesTableViewController - configureFetchedResultsController: fetch failed \(error.localizedDescription)")
        }
        
    }
//
//    func checkForUpdate(_ updatedObjects: Set<NSManagedObject>) {
//        if let rootObject = modelObject(),
//            let managedObject = rootObject as? NSManagedObject,
