             }
         }
     }
-//    
+    
+    // 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,

    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        dateFormatter.dateStyle = DateFormatter.Style.short
        dateFormatter.timeStyle = DateFormatter.Style.medium

    
    func saveObject() {
        view.endEditing(true)
        
        guard let managedObjectContext = coreDataManager?.mainThreadManagedObjectContext else {
                fatalError("ViewController - saveObject: guard statement failed for either no managedObjectContext or invalid input")
        }
        guard let newTaskType: TaskType = NSEntityDescription.insertNewObject(forEntityName: "TaskType", into: managedObjectContext) as? TaskType else {
            fatalError("ViewController - saveProject : could not TaskType Truck object")
        }
        newTaskType.addDate = NSDate()
        newTaskType.name = "工作"
        newTaskType.hidden = false
        newTaskType.lastUpdate = NSDate()
        print("\(newTaskType)")
        coreDataManager?.save()
    }
    
    func managedObjectContextChanged(_ notification: Notification) {
